Get rid of Vim's highlight after searching text

前端 未结 8 2100
梦如初夏
梦如初夏 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:04

    Completely disable search highlights

    :set nohlsearch
    

    Clear until next search

    :nohlsearch
    

    or :noh for short. This clears highlights until a new search is performed or n or N is pressed


    Clear on pressing custom map

    • Clear highlights on hitting the ESC key

      nnoremap  :noh
      
    • Clear highlights on pressing \ (backslash) twice

      nnoremap \\ :noh
      

提交回复
热议问题