Search code examples
vimhighlight

How to turn off highlighting after using search?


Search highlighting becomes annoying after I've found the target word by using /string in vim. Could someone tell me what is the quickest way to turn off search highlighting? Thanks.


Solution

  • The simplest way is to enter the :noh command.

    Additionally, you can add this line to your .vimrc to map that command to the Enter key, so you can simply press Enter after searching to clear highlight:

    :nnoremap <CR> :noh<CR><CR>