4

After performing some search operation vim highlights its occurrences. These occurrences persist as long as editor is opened or another search is performed.

How to clear previous search highlights after performing some operation?

marked as duplicate by SibiCoder, nobe4, statox, DJMcMayhem, Peter Rincker Jun 15 '16 at 18:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

8

You can look in the doc at :h nohl:

When there is a previous search pattern, highlight all its matches.

A useful mapping is the following:

nnoremap <C-l> :nohl<CR><C-L>

Originally <C-l> redraw the screen, with this mapping you first clear the highlighting and then redraw the screen.

Not the answer you're looking for? Browse other questions tagged or ask your own question.