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?
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
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.