Replay macro a five times
5@a
Example
Normal 0 / 1Normal 1 / 1one
two
three
four
five
sixCursor on line 1, column 1one!
two!
three!
four!
five!
sixCursor on line 6, column 3Execute register a up to five times.
Vim registers
aRegister a- Characterwise
A!<Esc>j
Macro
- Recording register
None- Executing register
None
Command applied
Vim registers
aRegister a- Characterwise
A!<Esc>j
Macro
- Recording register
None- Executing register
None
Before & after
one
two
three
four
five
sixCursor on line 1, column 1Vim registers
aRegister a- Characterwise
A!<Esc>j
Macro
- Recording register
None- Executing register
None
one!
two!
three!
four!
five!
sixCursor on line 6, column 3Vim registers
aRegister a- Characterwise
A!<Esc>j
Macro
- Recording register
None- Executing register
None
Start in Normal mode. Register a contains A! followed by Esc and j: append !, then move down one line.
Details & Vim help
Example replayed in Vim
Execute register a up to five times.
A count before @ repeats the macro. A failing command may stop execution before all repetitions finish, so use recordings with deliberate starting and ending positions.