Macros
Development reference · View source
Macros live in the Space m namespace.
| Key | Action |
|---|---|
Space m m | Start recording the default macro, or stop the recording |
Space m M then a register | Start recording a macro under that register |
Space m r | Replay the default macro; accepts a count |
Space m R then a register | Replay that macro; accepts a count |
Space m l | List every recorded macro; Enter replays the selected one |
Recording:
Space m mstarts recording and the same keys stop it. The stopping keys are not recorded.Space m mrecords into the default macro, register@.Space m Masks for a register first; any printable key names one.- Only one recording runs at a time. Starting a second is refused rather than replacing the first.
- A recording captures raw input in arrival order and replays it through the same dispatch, so a replay does exactly what the typing did.
Example: add a semicolon to the end of several lines.
Space m m— start recording.A ; Escape j— append;, return to Normal, move down.Space m m— stop.Space m r— replay on the next line. It accepts a count.
Replaying:
- Replay runs between frames, not by holding the input loop.
EscapeorCtrl-ccancels the remaining work. Inputs already run are kept, because a macro may have done things that cannot be rolled back.- While work remains, the interaction line shows progress and the cancel keys.
Safety limits (reaching any of them stops the whole replay):
- Direct and mutual recursion are refused, naming the register chain.
- Distinct macro calls may nest up to 16 levels.
- One top-level replay has a 10,000-unit budget shared by raw key events, characters of literal text, counted repetitions, and nested macros. Counted commands expand between frames.
- Range operations whose exact meaning cannot be split are limited to 128 repetitions in one recorded input, and refused before taking effect when larger.