Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you make Vim unhighlight what you searched for? [duplicate]

People also ask

How do I get rid of red highlight in Vim?

If you want to avoid this in an apache . conf file like I did, you can add it to the end, like "# vim: nospell". Or, you could add words to spelling dictionary. I have to do set nospell , every time that red happens!

How do you unhighlight a command?

Select the text that you want to remove highlighting from, or press Ctrl+A to select all of the text in the document. Go to Home and select the arrow next to Text Highlight Color. Select No Color.


:noh (short for nohighlight) will do the trick.


Just put this in your .vimrc

" <Ctrl-l> redraws the screen and removes any search highlighting.
nnoremap <silent> <C-l> :nohl<CR><C-l>

/lkjasdf has always been faster than :noh for me.


" Make double-<Esc> clear search highlights
nnoremap <silent> <Esc><Esc> <Esc>:nohlsearch<CR><Esc>