Macros
Record and replay keystroke sequences to automate repetitive tasks.
Recording
Start recording by pressing q followed by a register name:
qa Start recording to register 'a'
q0 Start recording to register '0'
All subsequent keystrokes are recorded until you stop.
Stop recording by pressing q while not in a recording context:
q Stop recording
Playback
Execute a recorded macro:
@[a-z] Play macro from register 'a'
Repeat the last played macro:
@@ Repeat last macro
Compound repeats:
5@a Play macro 'a' five times
Workflow Example
Record a macro to format a column as currency:
Move to first cell in column.
Press
qato start recording to registera.Press
:then typeformat currency <Enter>.Press
jto move down.Press
qto stop recording.Press
10@ato apply to the next 10 cells.