Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cancel the select pattern in VIM

Tags:

vim

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,

like image 299
Yongwei Xing Avatar asked Jul 27 '10 09:07

Yongwei Xing


3 Answers

The command you want is :nohl.

like image 56
Moritz Avatar answered Oct 05 '22 22:10

Moritz


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

like image 25
msw Avatar answered Oct 05 '22 23:10

msw


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

like image 31
jps Avatar answered Oct 06 '22 00:10

jps