How do I debug a macro by stepping through it command by command?
:let g:debug_macro=1 | normal @a
When a macro doesn't work as expected, debugging it step by step is essential.
69 results for "dd"
:let g:debug_macro=1 | normal @a
When a macro doesn't work as expected, debugging it step by step is essential.
:m +1
The :move command (abbreviated :m) relocates lines to a new position in the buffer without touching any registers.
"0p
Register 0 (the yank register) always contains the text from your most recent yank command — and unlike the unnamed register, it is never overwritten by delet
"-p
The small delete register ("-) captures text from delete operations that are less than one line — like dw, x, dt.
:let @a = 'text'
Vim's :let command lets you assign a value directly to any named register without performing a yank or delete operation.
registers #registers #macros #vimscript #ex-commands #normal-mode
:normal!
The :normal! command (with !) executes normal mode keystrokes exactly as Vim defines them, ignoring any user-defined mappings.
:norm! {command}
:normal {command} runs a sequence of Normal mode keystrokes from the command line (or a range of lines with :%normal), but it applies your custom key mappings.
command-line #ex-commands #macros #normal-mode #command-line
:put a ... edit ... "ayy
Recorded macros are stored as plain text in registers, but editing them by re-recording is tedious for complex sequences.
:Oil
oil.
"add
How it works When you delete text in Vim with commands like dd, dw, or x, the deleted text goes into the unnamed register and the numbered registers (1-9).
nnoremap <nowait> {key} {action}
The flag on a mapping tells Vim not to delay waiting for a longer key sequence.
ddp
The ddp sequence swaps the current line with the line below it.
:%normal command
The :normal command executes normal mode commands programmatically on a range of lines.
"1p through "9p
Registers 1-9 contain the last 9 deletions or changes that are at least one line long.
"=strftime('%F')<CR>p
The expression register lets you compute text on demand and insert it without leaving Normal mode workflows.
registers #registers #expression-register #normal-mode #automation
g??
Vim has a built-in ROT13 operator g? that encodes text by rotating each letter 13 positions in the alphabet.
:Git log --oneline --graph
Tim Pope's vim-fugitive provides a complete Git interface inside Vim.
gUU
The gUU command uppercases every character on the current line instantly — no visual selection or motion required.
qa...@aq
A recursive macro calls itself at the end of its recording, causing it to repeat until a motion or search fails.
!{motion}{program}
The ! operator in normal mode lets you pipe a range of text through any external program and replace it with the output.