Get rid of Vim's highlight after searching text

前端 未结 8 2092
梦如初夏
梦如初夏 2020-12-02 08:37

In VIM, after finding text with \"/\" command, that text remains highlighted.

What is the command to remove that? I don\'t want to remove highlighting capability at

8条回答
  •  既然无缘
    2020-12-02 09:08

    If you don't want to remove highlighting one of the best ways is to clear the search register, unless of course you need the search items later. This will prevent you from having to re-enable the highlighting and(Edit: noh does not permanently disable highlighting) prevent you from accidentally jumping around. This is how I have mine setup:

    nmap ,/ :let@/=""

    What this does is map the key sequence ,/ in normal mode to clear the search register @/ by setting it to an empty string. This is just an alternative to what has already been stated.

提交回复
热议问题