Vim Macros#
Recording Vim Macros#
Press qq to start recording into register q [1].
Then do your things. Then hit q again to stop recording.
Editing Vim Macros in a Buffer#
Hit
"qpto put registerqinto the current buffer.Edit the resulting line. If you need a literal ESC character, hit
<C-v><ESC>. See:help i_CTRL-Vfor more info [2].Yank the line into register
qwith"qyy.
This was inspired by a video from typecraft [3].
Registers#
To yank a word to register a type "ayw.
Show all registers with :reg and the register a with :reg a.
Command Mode#
To paste register a in command mode (:), hit Control-r a.
https://vi.stackexchange.com/a/15038