pcha8g
Last Updated: February 25, 2016
·
5.214K
· glauco
3eed48f7ceeb0151a5f1138980270a82

Clear the last search highlighting in Vim

vim

After you do a search in vim you get all the occurrences highlighted. When you don't want the highlight anymore, most people (me included) usually do another search for something gibberish that can't be found.

Today I just discovered that there is an easier way to do that. You just need to add the following line to your .vimrc and it's done!

nnoremap <esc> :noh<return><esc>

By putting that in your .vimrc you can then just press <esc> after you search to clear the highlighting from the previous search.

Say Thanks
Respond

1 Response
Add your response

8310
3547179be285fedaf4ea10605142a698

I just do /;slkdfj or whatever. no keymapping and instantaneous.

over 1 year ago ·
Filed Under