Yank
Yank

Reputation: 748

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.

Upvotes: 12

Views: 751

Answers (1)

Jonathon Reinhart
Jonathon Reinhart

Reputation: 137467

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>

Upvotes: 10

Related Questions