Remove Highlighting After Vim Search
Depending on your configuration files, you might find that Vim highlights search results, sometimes keeping the highlighting the next time you open the file. This highlighting remains until you search again, or you turn it off.
Of course, if you don’t know how to turn it off, you have to put up with it, or search for something not present in your file. Since I didn’t know how to turn of highlighting, which is enabled by default on the Fedora packaging of Vim, I began a search for a method to turn off the highlighting when I didn’t need it - but retaining the feature for its usefulness.
So, after I spent some time in the Vim help files, I discovered the command nohlsearch
, which does exactly what I wanted.
So, to turn off the highlighting from a search in Vim, enter :nohlsearch
in command mode.