I have :set hlsearch
as default value.
When I search for something, search terms get highlighted. However many times I want to get rid of the highlight,
Try this:
set hlsearch!
nnoremap <F12> :set hlsearch!<CR>
and hit F12 to clear when desired. Use :noh
in command mode to clear.
:noremap <silent> <c-l> :nohls<cr><c-l>
This would redraw the screen and clear any search terms with Control-L, handy :) easier than reaching up to the F keys.
This might suit your needs:
nnoremap <esc> :noh<return><esc>
With a little tinkering you can make it work in insert mode.
Try the :noh
command.
vi/vim notes
I have the following in my .vimrc
:
map <silent> <C-N> :let @/=""<CR>
you could search for something not in the text file. Nothing will be highlighted in this case. (e.g. /349i5u9sgh)