Chapter 76
The macro editor
Open the macro editor from Settings ▸ Library ▸ Macros: New inside a collection, or Edit on a macro. Its title is New Macro or Edit Macro.
| Field | What it does |
|---|---|
| Name | A label for the macro. |
Trigger (for example /sig) | The text that starts it. A macro expands when you type the trigger followed by a space, tab or return. |
| Match | How the trigger is read: Exact text, Prefix, or Regular expression. A regular expression that could hang the editor is refused: "That regular expression could hang the editor. Simplify it." |
| Replacement | The text it expands to. |
| Insert Date/Time | A menu that adds a date or time token to the replacement. |
| Enabled | Turns the macro on or off without deleting it. |
| Don't expand inside code | Stops the macro firing inside code spans and code blocks. |
| Cancel, Save | Close or keep the macro. If it cannot be saved, the message says why. |
In the replacement, $1, $2 and so on are tab stops, and $0 is where the cursor lands. After a macro expands, Tab (or Next Field) jumps from stop to stop. Dates and times use tokens: {{date:yyyy-MM-dd}}, {{time:HH:mm:ss}} and {{datetime:MM/dd/yyyy h:mm a}}, and named formats iso8601, rfc2822, unix, short, medium, long and full. A Now: line under the field shows what the replacement would produce at this moment.