Record, stop and replay
The technique
The macro ends with j0, so each replay starts at the beginning of the next line.
Keys in this lesson
- qa
- Record a macro into register a. Press q to stop.
- @a
- Play macro a.
- @@
- Play the last macro again.
Before this lesson: Insertion; positioning; repetition.
More about this lesson
Record once, account for the edit made while recording, then replay.
qa starts recording into register a; q in Normal mode stops it. @a replays that macro; @@ repeats the last macro used. Recording already performs the first edit. Include positioning for the next line and check one replay before doing many.
Example
A macro that appends a review marker, leaves Insert mode and moves down can process several notes. The first note was changed during recording; only the remaining notes need replay.
Use Reset to try again.