Training plan › Power

Macros

Record once, replay a thousand times.

A macro records your keystrokes so you can replay them. qa starts recording into register a, q stops. @a replays it and @@ repeats the last one. The trick for a repeatable macro: always end with a motion that leaves you ready for the next run (usually j).

4 steps · 5 min · 90 XP

  1. Record: qa ... q
  2. Replay: @a
  3. Replay with a count: 3@@
  4. Alternative: :normal on a range

Create a free account