What are Vim's built-in character class shortcuts for search patterns?
\d \w \s \a \l \u
How it works Vim provides shorthand character classes that save you from writing out full bracket expressions.
\d \w \s \a \l \u
How it works Vim provides shorthand character classes that save you from writing out full bracket expressions.
yiw
How it works The command yiw yanks (copies) the inner word under the cursor.
.\{-}
How it works In most regex engines, ? or +? make quantifiers non-greedy (matching as little as possible).
/foo\|bar
How it works The \ operator in Vim's search pattern works like a logical OR, letting you match any one of several alternatives.
]s and [s
How it works When spell checking is enabled in Vim with :set spell, misspelled words are highlighted.
q/
How it works Vim keeps a history of all your search patterns.
gD
How it works Vim provides two built-in commands for jumping to where an identifier is defined, without needing tags or an LSP: gd (lowercase) searches backward
:changes
How it works Vim maintains a change list that records the position of every change you make to a buffer.
/\cpattern
How it works By default, Vim searches are case-sensitive: /Hello will not match hello or HELLO.
:jumps
How it works Vim keeps a jump list that records your cursor position every time you make a jump.
qa0f=20i <Esc>20|C= <Esc>lDjq
How it works Aligning text on a delimiter such as = without plugins requires a clever macro technique.
( and )
How it works Vim defines a sentence as text ending with .
qa{edits}@bq
How it works Vim macros can call other macros, creating a modular system of reusable building blocks.
zj and zk
How it works When working with folded code in Vim, you often want to skip from one fold to another without unfolding anything.
<C-f> to scroll forward, <C-b> to scroll backward
How it works Vim provides two commands for scrolling by an entire screen (page) at a time: Ctrl-F (Forward) scrolls the view one full page down through the file
qama{edits}'aq
How it works When a macro needs to jump to different parts of the file and then return to a starting position, marks are the perfect tool.
W, B, and E
How it works Vim distinguishes between two types of word objects: A word (lowercase w, b, e) is a sequence of letters, digits, and underscores, or a sequence of
:nnoremap <buffer> <leader>r :!python %<CR>
How it works By adding to a mapping command, the mapping only applies to the current buffer.
M to move to the middle, L to move to the bottom
How it works Vim offers three commands to jump the cursor to specific vertical positions on the visible screen without scrolling: H moves to the top of the scre
qabi"<Esc>ea"<Esc>wq
How it works This macro wraps the current word in double quotes and moves to the next word, making it easy to repeat across a line or file.