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,983
  • 24
  • 70
  • 90
  • 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,144
  • 2
  • 56
  • 55
2

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

msw
  • 42,753
  • 9
  • 87
  • 112
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
  • 956
  • 6
  • 8