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?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
You can look in the doc at
When there is a previous search pattern, highlight all its matches.
A useful mapping is the following:
nnoremap <C-l> :nohl<CR><C-L>
<C-l> redraw the screen, with this mapping you first clear the highlighting and then redraw the screen.