To turn off highlighting until the next search:
:noh
Or turn off highlighting completely:
set nohlsearch
Or, to toggle it:
set hlsearch! nnoremap <F3> :set hlsearch!<CR>
ID : 397
viewed : 140
Tags : vimfull-text-searchhighlightvim
90
To turn off highlighting until the next search:
:noh
Or turn off highlighting completely:
set nohlsearch
Or, to toggle it:
set hlsearch! nnoremap <F3> :set hlsearch!<CR>
83
From the VIM Documentation
To clear the last used search pattern:
:let @/ = ""
This will not set the pattern to an empty string, because that would match everywhere. The pattern is really cleared, like when starting Vim.
77
61
I found this answer years ago on vim.org:
Add the following to your .vimrc:
"This unsets the "last search pattern" register by hitting return nnoremap <CR> :noh<CR><CR>
Thus, after your search, just hit return again in command mode, and the highlighting disappears.
51
From http://twitter.com/jonbho/status/2194406821
" Clear highlighting on escape in normal mode nnoremap <esc> :noh<return><esc> nnoremap <esc>^[ <esc>^[
The second line is needed for mapping to the escape key since Vim internally uses escape to represent special keys.