Replay the last macro again
@a then @@
Example
Normal mode on line 1. Lines: alpha, beta, gamma.
alpha
beta
gammaCursor on line 1, column 1- qaI# <Esc>jq Record macro a · prefix alpha with # and a space; move to beta
- @a Replay a · prefix beta; move to gamma
- @@ Replay a again · all three lines now start with # and a space
# alpha
# beta
# gammaDetails & Vim help
Use @@ to execute the most recently used register as a macro.
Keep applying a recorded edit without remembering its register name.
The example starts before recording on line 1. @@ repeats the last @ register; it does not start or stop recording. A macro error can stop playback, so test once before adding a count.
Record qaI# <Esc>jq on line 1, run @a on line 2, then @@ on line 3. The space after # is inserted text.
Try it in Vim
- From line 1, type qaI# <Esc>jq, including the space after #. This records a prefix insertion followed by j into register a.
- On line 2, type @a to prefix it and advance.
- Type @@ to do the same on line 3.