Macros#
A macro in Vim is simply a sequence of recorded commands.
- Q โ Starts recording a macro. Perform actions, then press Q again to stop recording.
- @a โ Replays the macro recorded in register a.
๐ Editing a Macro#
- Create a new buffer:
- Paste the contents of the macro from register a:
- Edit the macro content:
- A โ Move to end of line in normal mode.
- ^[ (Escape) โ Exit insert mode.
- J โ Join the line with the one below.
- View all registers:
- Copy and paste the edited text back into register a:
- “ayy โ Copy the current line into register a.
- Run the updated macro: