5

When I try to search some words in a article, it would highlight the pattern. After I have already found what I want, what should I do to cancel the select pattern, which means I don't want the words to be highlighted.

Best Regards,

Yongwei Xing
  • 12,333
  • 21
  • 68
  • 89
  • 2
    possible duplicate of [How to get rid of search highlight in vim](http://stackoverflow.com/questions/1352242/how-to-get-rid-of-search-highlight-in-vim) – msw Jul 27 '10 at 09:32
  • 2
    possible duplicate of [vim clear last search highlighting](http://stackoverflow.com/questions/657447/vim-clear-last-search-highlighting) –  Jul 27 '10 at 09:58

3 Answers3

4

The command you want is :nohl.

Moritz
  • 14,034
  • 2
  • 54
  • 54
2

Before I turned search highlighting off permanently, /sdjrgjlsfj was my preferred command.

msw
  • 41,609
  • 8
  • 82
  • 107
1

I've mapped ESC-u to do this (like the less command):

nnoremap <ESC>u :nohlsearch<CR>

I learned that from this page: http://www.semicomplete.com/blog/geekery/make-vim-hlsearch-like-less.html

jps
  • 908
  • 6
  • 6