Undo and redo
Ctrl+Z goes back, Ctrl+Y goes forward, 100 steps each.
| Key | Action | Message row |
|---|---|---|
| Ctrl+Z | Undo | Undid last action / Nothing to undo |
| Ctrl+Y | Redo | Redid last action / Nothing to redo |
- Undo restores the cursor position too, taking you back to where the edit happened.
- As long as you do not type anything new, you can redo your way forward again.
- Typing after an undo clears the redo history — as in every editor.
- Each tab has its own history (see 2.1.4).
- An automatic reload after an external change: the old steps no longer fit the new content, so they are dropped (see 2.1.7).
- Closing the tab: the history belongs to the tab and reopening the file does not restore it.
Redo is Ctrl+Y in the default profile but Ctrl+R in Erya Classic — where Ctrl+Y deletes a line instead. This is the pair people press by mistake most often after switching; check the hint bar (see 4.1.2).
How big is one step
Usually one keystroke, except for five actions that count as one.
One keystroke, one step
- Typing a character
- Deleting one (Backspace / Delete)
- One Enter
- Cutting or deleting a line
- One paste
So 100 steps is roughly 100 characters. Undo is a poor way to roll back a long passage you have just typed.
One step for the whole batch
- Replace all (F6) — however many matches
- Formatting (Ctrl+T)
- Paragraph reflow
- Inserting a phrase
- Running a macro — no matter what it did
All five are “one command, wide effect”, so they are deliberately merged: one Ctrl+Z takes the lot back.
Writing a byte takes two hexadecimal digits (high nibble, then low), and the two presses count as one step. See 3.3.6.
What phrases are for
Capture text you keep retyping, insert it with one key, and it advances to the next entry.
Phrases suit standard closings in correspondence, code templates, paths and names you type constantly, or a set of tags you insert repeatedly. What makes them unusual is that each insertion advances to the next phrase, so pressing the key several times lays out the whole set in order.
Capturing and inserting phrases
Four actions: capture, insert, load, save.
| Action name | Key in Classic | What it does |
|---|---|---|
| capture_phrase | F9 | Captures the selection, or the whole current line if nothing is selected. |
| insert_phrase | F10 | Inserts the next phrase at the cursor, replacing any selection. |
| load_phrases | Shift+F9 | Loads .erya-phrases.json. |
| save_phrases | Shift+F10 | Writes .erya-phrases.json. |
What the message row tells you:
- Captured: “Phrase captured; 3 phrase(s) available”
- Already there: “That phrase is already in the library” — duplicates are never stored twice
- Nothing to capture: “There is no text to capture as a phrase”
- Nothing to insert: “The phrase library is empty; capture a phrase first”
- Inserted: “Inserted phrase 2/3”
Where phrases are stored
Next to the document you are editing, and only when you ask.
Capturing only puts a phrase in memory. Exit without running “save phrases” and it is gone. Erya never writes that file by itself — deliberately, so it does not leave files in other people's directories.
| File | Location |
|---|---|
| .erya-phrases.json | The directory of the current document. Editing /home/leo/docs/report.txt means /home/leo/docs/. |
| .erya-macro.json |
In effect, phrases and macros follow the folder: one set beside project A, another beside project B. Copy the JSON across to share them.
The phrase file is simply an array of strings. Open it with Ctrl+O, tidy it with Ctrl+T (see 3.1.7), add a few entries by hand and save; the next load_phrases picks them up.
Recording and running macros
Record a sequence of keys, then replay the whole thing.
- Start recording. The message row says “Macro recording started; run the record-macro action again to stop”. From now on every key you press is captured.
- Do the thing you want to repeat. Movement, typing, deletion, searching — all fine. The macro management keys themselves are not recorded.
- Press again to stop. “Macro recording stopped with 12 key(s)”.
- Run it. “Macro executed with 12 key(s)”. Press it repeatedly to repeat the effect.
| Action name | Key in Classic | What it does |
|---|---|---|
| toggle_macro_recording | Ctrl+F2 | Start / stop recording |
| run_macro | Ctrl+F3 | Run the recorded macro |
| load_macro | Ctrl+Shift+F2 | Load .erya-macro.json |
| save_macro | Ctrl+Shift+F3 | Write .erya-macro.json |
However much it changed, one Ctrl+Z afterwards returns the document to the state before the run. Experiment freely — if the result is wrong, undo and adjust.
You get “Stop recording before running the macro”. And running before anything has been recorded gives “There is no macro to run”.
Where macros are stored
Same as phrases: the document's directory, saved on request.
- The file is .erya-macro.json and holds the recorded key sequence.
- Loading replaces the macro currently in memory and stops recording if it was on.
- A failed load or save (permissions, broken JSON) reports “Phrase/macro operation failed: …”.
What is stored are the physical keys (Ctrl+K), not the meaning “cut the current line”. Replay an old macro under a different key profile and the result can be entirely different. If you share macro files, agree on a profile first.
Bind a key before you can use them
All eight phrase and macro actions are empty in the default profile.
To work in as many terminals as possible, Erya Terminal Safe leaves the eight phrase and macro actions — and five block actions — unbound (see 1.3.9). In F1 help their key column is blank, meaning “the feature is here, but no key calls it”.
Two ways to get them working:
① Switch to Erya Classic
F2 → ← → to Erya Classic → Enter.
All eight get keys immediately (F9, F10, Ctrl+F2…), at the price of changing every other shortcut to the older set.
② Bind only what you need
F2 → E on the key-bindings row → find the action, Enter, type a key → S to save as your own TOML.
Everything else in the default profile stays as it is (see 4.1.4).
Common problems
Six situations around undo, phrases, and macros.
| Symptom | Cause and fix |
|---|---|
| Undo runs out before you are done | Only 100 steps, one character each (2.4.2). To discard a lot, close the tab without saving and reopen. |
| Undo stops working entirely | The document was reloaded after an external change (2.1.7). |
| Phrases are gone after a restart | They were never saved. Run “save phrases” after capturing (2.4.5). |
| Phrases will not load in another directory | The JSON follows the document's directory. Copy it across (2.4.5). |
| A macro replays into nonsense | It records keys, and the profile changed (2.4.7). |
| None of these keys do anything | They have no default binding (2.4.8). |