How do I add more commands to a macro I already recorded?
qA
If you finish recording a macro and realize you forgot a step, you don't need to re-record the whole thing.
macros #macros #registers #normal-mode #editing #productivity
qA
If you finish recording a macro and realize you forgot a step, you don't need to re-record the whole thing.
macros #macros #registers #normal-mode #editing #productivity
cit
The cit command deletes everything between the nearest pair of HTML/XML tags and drops you into insert mode, ready to type the replacement.
ci"
The ci" command deletes everything inside the nearest pair of double quotes and drops you into insert mode, ready to type the replacement.
cis
The cis command deletes the entire sentence under the cursor and drops you into insert mode, ready to type a replacement.
ct{char}
The ct{char} command deletes everything from the cursor up to (but not including) the specified character and drops you into insert mode.
editing #editing #motions #normal-mode #text-objects #productivity
cw vs ciw
The cw and ciw commands both change a word, but they behave differently depending on cursor position.
editing #editing #text-objects #motions #normal-mode #productivity
xp
The xp command swaps the character under the cursor with the character to its right.
<C-w><C-w>
The (Ctrl+w Ctrl+w) command cycles the cursor to the next window in the current tab.
~
The ~ command toggles the case of the character under the cursor — uppercase becomes lowercase and vice versa — then advances the cursor one position to the
u
The u command undoes the last change you made in normal mode.
gUiw
The gUiw command converts the entire word under the cursor to uppercase.
:registers
The :registers command displays the contents of all Vim registers, showing you exactly what text is stored in each one.
<C-v>
The (Ctrl+v) command enters visual block mode, which lets you select a rectangular column of text across multiple lines.
yy
The yy command yanks (copies) the entire current line, including the newline character.
"+y
The "+y command yanks (copies) text into the system clipboard register, making it available to paste in other applications outside of Vim.
/pattern
The /pattern command searches forward through the file for the given pattern.
#
The # command searches backward for the exact word under the cursor, jumping to the previous occurrence.
*
The command searches forward for the exact word under the cursor, jumping to the next occurrence.
vat
The vat command visually selects the nearest enclosing HTML or XML tag and all of its contents, including the opening and closing tags themselves.
visual-mode #visual-mode #text-objects #editing #normal-mode
V
The V (uppercase) command enters visual line mode, which selects the entire current line.