How do I call one macro from inside another macro in Vim?
When recording a macro, you can execute another macro inside it by pressing @b (or any register) during the recording.
When recording a macro, you can execute another macro inside it by pressing @b (or any register) during the recording.
<C-r><C-f>
While typing a command, inserts the filename under the cursor in the buffer at the command-line prompt.
:ldo execute 'normal @q'
:ldo runs an Ex command on each entry in the location list — the buffer-local cousin of the quickfix list.
guu / gUU
Vim's case operators gu (lowercase) and gU (uppercase) follow the same doubling convention as dd and yy: repeating the operator letter applies it to the whole c
"/p
Vim stores the last search pattern in the search register "/.
<C-a> / <C-x> (vim-speeddating)
vim-speeddating (by Tim Pope) extends Vim's built-in and increment/decrement operators to understand dates, times, roman numerals, and other ordered sequences.
vaB
The aB text object (around Block) selects everything from the matching { to the closing } — including the braces themselves.
:argdo execute 'normal @q' | update
:argdo runs an Ex command on every file in Vim's argument list (the arglist).
<C-r>0
In Insert mode, {reg} pastes the contents of any register inline at the cursor.
<C-g>u
By default, Vim treats an entire Insert mode session (from entering Insert mode to pressing ) as a single undo unit.
<C-w>n
n creates a new empty buffer and opens it in a horizontal split above the current window.
:args **/*.py
Vim's argument list (arglist) is a named list of files that you can operate on as a group.
:Rename {newname}
vim-eunuch (by Tim Pope) adds Unix shell operations as first-class Vim commands.
vis
The is (inner sentence) text object selects the sentence the cursor is in — excluding any leading or trailing whitespace that separates sentences.
:t.
The :t (short for :copy) command copies lines from one location to another.
:%!{command}
The ! filter command in Vim sends a range of lines to an external program as standard input, then replaces those lines with the program's standard output.
:put ={expression}
The :put command inserts the contents of a register as a new line below the cursor.
va"
Vim's text objects let you select structured regions of text with two-keystroke shortcuts.
r<CR>
You can split a line at the cursor without entering Insert mode by using r.
:saveas
The :saveas {filename} command writes the current buffer to a new file and makes that new file the current buffer's file.