8

i have a pre-configured .vimrc file under ~/ ,after searching a term through '/' key,all items matched are highlighted,but after i find the need position and hit enter,the highlighted terms are still highlited... it's very disappointing since when i issue --c/"--,the screen is mashed with highlightings.which setting controls search highlighting facility?thanks!

GreenGiant
  • 4,930
  • 1
  • 46
  • 76
Pwn
  • 3,387
  • 11
  • 38
  • 42
  • possible duplicate of [vim clear last search highlighting](http://stackoverflow.com/questions/657447/vim-clear-last-search-highlighting) – mtk May 14 '13 at 09:44
  • Does this answer your question? [Vim clear last search highlighting](https://stackoverflow.com/questions/657447/vim-clear-last-search-highlighting) – Erwin Brandstetter Jun 18 '21 at 00:06

3 Answers3

12

You can issue :nohl to turn off highlighting until the next search. I would recommend mapping that to a key.

:map <F4> :nohl<CR>

If you want to turn off highlighting forever, use :se nohlsearch in your .vimrc

soulmerge
  • 73,842
  • 19
  • 118
  • 155
6

If you type ":nohls<enter>" it will turn off the search highlighting. (The next time you do a search, it will be highlighted, this is not a permanent setting. It is useful for turning off the highlighting for the current search.)

Not sure if that's what you're looking for.

Andy White
  • 86,444
  • 48
  • 176
  • 211
  • thanks,but i want some vim setting that control highlighting behaviour,not a command to remove the highlighting. – Pwn Apr 21 '09 at 16:01
4

Vim clear last search highlighting

Community
  • 1
  • 1
Mykola Golubyev
  • 57,943
  • 15
  • 89
  • 102