小兔的筆記本

Just another WordPress.com weblog

關於 vim 的搜尋反白

Posted by Tsukino Usagi 於 三月 3, 2006

各家 distrobution 或者各個工作站的 global settings 裡的 vimrc 可能都有各自的設定, 若您遇到的環境剛好預設把「搜尋反白」打開(set hlsearch), 說不定您會想把它關掉.

如果是搜尋動作完, 想把反白弄掉而已, 可以用「讓 vim 搜尋一段檔案裡不可能出現的字串」的方式, 我的習慣是打:

/aaaaaaaaaaaaaaaaaaaaaa

這樣就不見了.

若是想暫時整個關掉的話, 可以打:

:set nohlsearch

這樣就關閉搜尋反白的功能了, 但只有目前這個 vim session 有效.

若想把這功能永遠關閉的話, 在 ~/.vimrc 裡寫入 set nohlsearch 就可以了.

4 回應 to “關於 vim 的搜尋反白”

  1. c9s said

    只是要暫時關掉的話
    用 :noh 即可。🙂

  2. Amelie said

    是要找這個指令!感謝!

  3. Christin said

    I know this if off topic but I’m looking into starting my own weblog and was wondering what all is required to get setup? I’m assuming having a blog
    like yours would cost a pretty penny? I’m not very web savvy so I’m not
    100% certain. Any suggestions or advice would be greatly appreciated.
    Kudos

  4. […] 來源:https://usagiblog.wordpress.com/2006/03/03/%E9%97%9C%E6%96%BC-vim-%E7%9A%84%E6%90%9C%E5%B0%8B%E5%8F%8… […]

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s

 
%d 位部落客按了讚: