How do I clear search highlighting in Vim?
:noh
The :noh (short for :nohlsearch) command clears the highlighting from the last search pattern.
2277 results for "@a"
:noh
The :noh (short for :nohlsearch) command clears the highlighting from the last search pattern.
gj / gk
When a long line wraps across multiple screen rows, the regular j and k motions skip the entire logical line.
<C-z> / :stop
Pressing in Vim sends it to the background of your shell session — just like suspending any Unix process.
:nnoremap / :inoremap / :vnoremap
Vim has two types of key mappings: recursive (:map, :nmap, :imap) and non-recursive (:noremap, :nnoremap, :inoremap).
"#p or <C-r># in insert mode
The # register always contains the name of the alternate file — typically the file you were editing just before the current one.
:let @/ = '\V' . escape(@0, '\')
When the text you yank contains regex characters, a normal / search can produce noisy or surprising matches.
:lua require('mini.surround').setup()
mini.
yos, yow, yol, yon, yoh
The vim-unimpaired plugin adds a set of paired bracket mappings, including a powerful family of option toggles.
"1p ... "2p ... "9p
Vim maintains a numbered register history from "1 through "9 that stores your last 9 deletes and changes.
:keeppatterns normal! @q<CR>
When you replay macros from Ex commands, Vim can overwrite @/ (the last search pattern) depending on what the macro does.
/\vTODO:\s*\zs.{-}\ze\s*($|#)
When TODO comments include prefixes, owners, or trailing metadata, a plain search often lands on the wrong part of the line.
> and <
How it works In visual mode, you can shift selected lines to the right or left using the > and to indent them or or shifts the selected lines one shiftwidth to
"=system('git rev-parse --short HEAD')->trim()<CR>p
If you frequently write commit references in notes, code comments, or release docs, you can avoid shell context switches and paste the hash straight from Vim.
ddp
The ddp sequence swaps the current line with the line below it.
:TestNearest (vim-test)
vim-test provides commands to run tests from within Vim.
K
Pressing K in normal mode runs a lookup program on the word under the cursor.
navigation #navigation #help #documentation #normal-mode #keywordprg
:tabmove +1
:tabmove normally takes an absolute position (:tabmove 0 moves the tab to the far left), but it also accepts relative offsets using + and -.
:set fillchars+=vert:│,fold:·
The fillchars option controls the filler characters Vim uses for various UI elements — window separators, fold fill lines, diff padding, and more.
nzzzv
When you are stepping through many matches, plain n often lands with poor context and can hide the match inside a closed fold.
:cabbrev
:cabbrev (command-line abbreviation) lets you define short aliases for longer Ex commands.