Keyboard shortcut to remove search highlighting in VIM

I just found this really useful little keyboard shortcut which unhighlights highlighted search strings in VIM:

stackoverflow.com How do you make vim unhighlight what you searched for?

To cut through the suspense of reading the link above here is the code to put into your vimrc:

" redraws the screen and removes any search highlighting.
nnoremap :nohl

After that typing Ctrl + l (that’s an L not a numeral 1) in command mode will unhighlight all highlighted search strings in a document.


Comments

Leave a Reply