How do I make % jump between matching HTML tags and language keywords like if/end?
packadd matchit
Vim ships with matchit.
795 results for "g* g#"
packadd matchit
Vim ships with matchit.
:set title
Enabling title tells Vim to update the terminal window's title bar with information about the current file.
iW vs iw
Vim has two flavors of the "inner word" text object that are easy to confuse: iw (lowercase) and iW (uppercase).
b
The b command moves the cursor backward to the beginning of the previous word.
\%^ and \%$
Vim's ^ and $ anchors match the start and end of a line, but sometimes you need to match the very beginning or very end of the entire buffer.
% (in netrw)
Vim's built-in file explorer netrw (opened with :Explore or :Ex) is more capable than it looks.
d3aw
Most Vim users know you can put a count before an operator (3dw) or use a text object once (daw).
editing #text-objects #editing #delete #normal-mode #motions
/\v(pattern)@<=match
Vim supports zero-width assertions (lookahead and lookbehind) in its regex engine.
search #search #regex #advanced-search #lookahead #lookbehind
set wildcharm=<Tab>
By default, pressing in a : mapping inserts a literal tab character rather than triggering wildmenu completion.
nnoremap <key> :<C-u>call MyFunc(v:count)<CR>
When writing custom mappings that call Vimscript functions, a common pitfall is that any count you type before the key (e.
:let @q = @:
The : register always holds the last Ex command you ran.
mf mt mc
Netrw, Vim's built-in file browser, supports a full marking system that lets you select multiple files and then perform bulk copy, move, or delete operations on
:'<,'>norm @a
Combining :normal with a visual range lets you replay a macro on each line of a selection individually — far more targeted than recursive macros or @@ repeati
qq{commands}@qq
A recursive macro calls itself at the end of its own definition, causing it to run repeatedly until Vim hits an error — such as reaching the end of the file o
\V
Vim's default search mode gives special meaning to characters like .
:normal! {cmd}
When you use :normal {cmd} in a Vimscript function, macro, or Ex command, Vim expands any keys through the user's current mappings first.
:set formatoptions+=a
Vim's formatoptions setting controls how automatic text formatting works.
:s/\v(\S+)\s*=\s*(.*)/\=printf('%-20s = %s', submatch(1), submatch(2))/
When a line contains uneven key = value spacing, quick manual fixes are easy to get wrong.
]c and [c
When files are open in Vim's built-in diff mode — whether via vimdiff, :diffsplit, or :diffthis — the ]c and [c motions let you jump precisely between chang
vim.diagnostic.jump()
Neovim 0.