How do I navigate Vim's undo tree branches to access states that u and Ctrl-R can't reach?
g- and g+
Vim's undo history is a tree, not a linear stack.
953 results for ":normal"
g- and g+
Vim's undo history is a tree, not a linear stack.
<C-d>
The (Ctrl+d) command scrolls the window down by half a screen, moving both the viewport and the cursor.
zl and zh
When a line is longer than the window width and wrap is off, Vim can display only part of it.
d/{pattern}<CR>
Vim lets you use a / search as a motion for any operator.
:put =execute('{cmd}')
The :put =execute('{cmd}') idiom inserts the output of any Vim Ex command as text in your buffer.
registers #registers #ex-commands #command-line #normal-mode
yiw{nav}viwp{nav}viwp
When you paste over a visual selection in Vim, the displaced text is moved into the unnamed register "".
registers #registers #visual-mode #editing #text-objects #normal-mode
vim.keymap.set
vim.
dV{motion}
In operator-pending mode — the brief state after typing an operator like d, c, or y but before entering the motion — you can prefix the motion with v, V, or
f{char}
The f{char} command moves the cursor forward to the next occurrence of {char} on the current line.
v / V / <C-v> (while in visual mode)
When you are already in visual mode and realize you need a different selection type, you do not have to exit and re-enter.
n.
The n.
{count}H and {count}L
Most Vim users know H jumps to the first visible line, M to the middle, and L to the last.
gd and gD
Vim's gd and gD commands jump to the declaration of the identifier under the cursor by searching upward through the file — no ctags setup required.
\%(pattern\)\@=
Vim's lookahead assertion \@= confirms that the current position is followed by a pattern — without including those characters in the match.
qaI"<Esc>A": "",<Esc>jq
This macro transforms a plain word into a JSON key-value pair format, useful for converting lists of field names into JSON structure.
cgn...{text}<Esc>.
The cgn + .
<C-w>=
The = (Ctrl+w then =) command resizes all open split windows so they have equal width and height.
:registers
The :registers command displays the contents of all Vim registers, showing you exactly what text is stored in each one.
zt / zb
The zt and zb commands scroll the viewport so the current cursor line appears at the top or bottom of the screen respectively, without moving the cursor.
/\%>5c\%<20cpattern
How it works Vim's search patterns support column position constraints using the \%c family of atoms.