How do I clear search highlights without disabling hlsearch permanently?
:nohlsearch
After a search in Vim, matched text is highlighted as long as hlsearch is enabled.
15 results for ":nohlsearch"
:nohlsearch
After a search in Vim, matched text is highlighted as long as hlsearch is enabled.
:noh
The :noh (short for :nohlsearch) command clears the highlighting from the last search pattern.
:set hlsearch
The hlsearch option highlights all matches of the current search pattern throughout the file, making it easy to see where matches occur.
set hlsearch
Use set hlsearch to highlight all matches of the last search pattern.
:set incsearch hlsearch
The combination of incsearch and hlsearch gives you live, interactive search highlighting.
:nnoremap key command
The :nnoremap command creates a non-recursive normal mode mapping.
:let @a = ''
Registers persist their contents throughout your Vim session and even across sessions if viminfo or shada is enabled.
:keeppatterns %s/\s\+$//e
Bulk cleanup commands often damage your navigation flow by overwriting the last search pattern (@/).
command-line #command-line #search #substitution #whitespace
:history /
Power users tend to run long, composable searches during refactors, but the default / and ? history navigation can be noisy when command history and search hist
"/
Vim stores the last search pattern in the special / register.
:let @/ = "pattern"
Assigning a string directly to the search register @/ with :let causes Vim to highlight all matches (if hlsearch is enabled) without performing a search or movi
:call matchadd('ErrorMsg', 'TODO')
matchadd() lets you highlight arbitrary patterns using any highlight group — without touching the search register or search highlighting.
"/p
Vim stores the last search pattern in the search register "/.
let mapleader = ' ' then nnoremap <leader>key command
The leader key is a configurable prefix for your custom key mappings.
:nnoremap / :inoremap / :vnoremap
Vim has two types of key mappings: recursive (:map, :nmap, :imap) and non-recursive (:noremap, :nnoremap, :inoremap).