How do you make Vim unhighlight what you searched for?

mbac32768 picture mbac32768 · Sep 19, 2008 · Viewed 108.2k times · Source

I search for "nurple" in a file. I found it, great. But now, every occurrence of "nurple" is rendered in sick black on yellow. Forever.

Forever, that is, until I search for something I know won't be found, such as "asdhfalsdflajdflakjdf" simply so it clears the previous search highlighting.

Can't I just hit a magic key to kill the highlights when I'm done searching?

Answer

Lee H picture Lee H · Sep 19, 2008

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