How do I clear a macro register to start fresh without using Vimscript?
qqq
Pressing qqq in normal mode is the quickest way to empty a macro register.
272 results for ":q"
qqq
Pressing qqq in normal mode is the quickest way to empty a macro register.
:let @q = 'content'
:let @{reg} = 'string' directly assigns content to any named register from Vimscript.
qq{cmds}@qq
A recursive macro is one that calls itself at the end of its own body.
qQ (or any uppercase register letter)
When recording a macro with qq, you can append additional keystrokes to the existing macro by recording into the uppercase version of the same register.
qq{actions}@qq
A recursive macro ends by calling itself, so it loops automatically without you pressing @q repeatedly.
qqqqqq{edits}@qq
A recursive macro calls itself at the end of its sequence, creating a loop that automatically repeats until a motion or command fails (such as hitting the last
qq{commands}@qq
A recursive macro calls itself at the end of its own definition, causing it to run repeatedly until Vim hits an error — such as reaching the end of the file o
qQ
Recording a macro with an uppercase register letter appends to the existing macro in the corresponding lowercase register instead of overwriting it.
0 or ^ at start of macro
A common macro pitfall is assuming the cursor starts at a specific column.
:let @a = @a . "\<CR>extra"
Vim stores macros as plain text in registers — the same registers used for yanked text.
qqq then qq{commands}@qq
A recursive macro in Vim calls itself at the end of its body, repeating automatically until one of its commands fails.
{count}@{register}
Prefix any macro execution with a count to repeat it that many times in a single command.
"qp
Macros are stored as plain text in named registers.
"qp {edit} 0"qy$ dd
When you record a macro and realize it has a mistake, the easiest fix is to paste the macro's keystrokes as text, edit them, and yank the corrected version back
:reg {name}
The :reg {name} command displays the current contents of one or more named registers in a formatted listing.
:[range]norm @{register}
The :normal command executes normal-mode keystrokes on each line in a range — including macro playback.
:{range} normal @{reg}
The :normal command lets you execute Normal mode keystrokes over a range of lines.
ZQ
ZQ is the discard-and-quit counterpart to ZZ.
<C-f> (command-line mode)
Pressing while in the command-line (:, /, or ? prompt) opens the command-line window with your partially-typed command already loaded and ready for full Vim edi
command-line #command-line #ex-commands #editing #navigation
:let @a = substitute(@a, 'old', 'new', 'g')
After recording a macro or yanking text into a named register, you may need to tweak it — fix a typo in a recorded macro, change a variable name in yanked tex