How do I look up documentation for the keyword under the cursor?
K
Pressing K in normal mode runs a lookup program on the word under the cursor.
navigation #navigation #help #documentation #normal-mode #keywordprg
953 results for ":normal"
K
Pressing K in normal mode runs a lookup program on the word under the cursor.
navigation #navigation #help #documentation #normal-mode #keywordprg
nzzzv
When you are stepping through many matches, plain n often lands with poor context and can hide the match inside a closed fold.
:split
The :split command (or s) splits the current window horizontally, creating a new window above with the same file.
qa ... q ... @a
Macros let you record a sequence of commands and replay them.
[/ and ]/
Vim provides two motions for navigating C-style block comments (/ .
[<Space> and ]<Space>
vim-unimpaired (by Tim Pope) provides paired bracket mappings for dozens of common operations.
) and (
The ) and ( motions move by sentence boundaries.
\%#
The \%# atom in Vim's regex engine matches the exact position of the cursor — zero-width, between characters.
gh
Vim's Select mode behaves like the familiar selection model in most GUI editors: after selecting text, any printable character you type replaces the selection a
nnoremap <expr> j (v:count == 0 ? 'gj' : 'j')
The map modifier turns a mapping's right-hand side into a Vimscript expression that is evaluated at the time the key is pressed, with its return value used as t
:keepmarks
When Vim executes commands that move or reorder lines — such as :sort, :%!sort, or :s/// across ranges — it automatically adjusts named marks to follow the
crs / crm / crc / cru
The vim-abolish plugin by Tim Pope adds a cr (coerce) prefix command that instantly converts the word under the cursor between common naming conventions.
]]
The ]] motion jumps forward to the next line that starts with { in the first column, which is typically the beginning of a C-style function or section.
/pattern1/;/pattern2/
Vim's search offsets allow chaining two patterns together with a semicolon.
dit
The dit command deletes the text inside the nearest enclosing HTML or XML tag pair without removing the tags themselves.
:set operatorfunc=MyFunc<CR>g@
Vim lets you define custom operators that behave like built-in ones (d, c, y) — they wait for a motion or text object, then act on the selected region.
getchar()
getchar() blocks and waits for the user to press a key, returning its numeric character code.
:let @q .= "j^"
Live macro recording is fast, but adjusting the tail of a macro by re-recording can be risky once it already works in most places.
macros #macros #registers #automation #normal-mode #workflow
g~~
Vim has three case-change operators that work like any other operator — you can combine them with motions, text objects, or double them to act on the whole li
visual-mode #editing #visual-mode #normal-mode #text-objects
@+
In Vim, @{register} executes the contents of any register as a macro.