Part 4 · Settings and reference / 4.1

Key bindings

Every action in Erya can be rebound, and even the defaults are just a TOML file. This chapter explains why the default profile looks the way it does, how the twelve bundled profiles differ, and how to make your own.

Reading time about 14 min Audience Anyone changing shortcuts Prerequisites 1.3 Version v1.0 ・ 2026-08-26
4.1.1

Why the default is “terminal safe”

Because terminals do not deliver every combination you press.

The built-in default profile is called Erya Terminal Safe. It deliberately avoids three families of combination that fail in many environments:

AvoidedWhy
Ctrl + function keysmacOS reserves these for the system (Spaces, Mission Control); the program never sees them.
Combinations relying on Alt / OptionOption types special characters on macOS, and many terminals need configuring before they send it as Meta.
Modified arrow keys (Alt+Shift+← and friends)A good number of terminals do not report them at all.

The price is that sixteen advanced actions have no default key: eight for phrases and macros (see 2.4.8), four block shifts and one block fill (see 2.2.6), two for paragraph reflow (see 3.1.8), and “show cursor position”, which the status bar already covers. The features are all present; they just need a key. The full list is in 4.4.6.

The old set has not gone anywhere

The complete 1.0 bindings survive as Erya Classic, and one press of F2 switches back. If your terminal does report modified arrows and Alt combinations — GNOME Terminal or Windows Terminal usually do — Classic is the more comfortable set.

4.1.2

The twelve bundled profiles

All in the keymap/ directory, all selectable as they are.

FileWho it is for
erya-terminal-safe.tomlThe default. Works everywhere; the safest choice across platforms.
erya-classic.tomlAnyone wanting the complete bindings, phrases, macros, and block shifts included.
nano.tomlPeople coming from nano.
vim.tomlPeople who want vim's keys (not modal editing — only the bindings).
emacs.tomlPeople coming from emacs.
macos.tomlAnyone who prefers macOS application conventions.
vscode.toml / vscode-macos.tomlPeople coming from VS Code.
visual-studio.toml / visual-studio-macos.tomlPeople coming from Visual Studio.
intellij-idea-classic.tomlPeople coming from IntelliJ IDEA.
eclipse.tomlPeople coming from Eclipse.

Where the default and Classic differ most

ActionTerminal SafeErya Classic
Open fileCtrl+OAlt+O
Save AsF12Ctrl+O
ReplaceCtrl+RCtrl+H
RedoCtrl+YCtrl+R
Delete lineCtrl+DCtrl+Y
CopyCtrl+CCtrl+Insert
Close tabF11Ctrl+F4
Previous / next tabF9 / F10Ctrl+Shift+Tab / Ctrl+Tab
Hexadecimal viewCtrl+PAlt+H
Block selectionCtrl+BAlt+B
Format documentCtrl+TCtrl+Shift+F
Ctrl+Y and Ctrl+R mean the opposite in the two profiles

In the default, Ctrl+Y is redo; in Classic it deletes a line, and Ctrl+R swaps the other way. This is the pair people press by mistake after switching — glance at the hint bar first (see 1.3.3).

4.1.3

Switching profiles in system settings

The simplest route: no files involved.

爾雅 Erya │ System settings
↑/↓ Field ←/→ Choose E Edit keys Enter Apply Esc Cancel
▶ Key bindings: ◀ Erya Terminal Safe ▶ Interface language: ◀ English (en) ▶
Erya Terminal Safe │ English
Choose with the arrow keys; Enter applies to every tab
  1. Press F2 for system settings.
  2. ↑ ↓ to the key-bindings row (the selected row is highlighted and marked ▶).
  3. ← → to change profile. The list is read from the keymap/ directory.
  4. Enter to apply. “Applied settings: Erya Classic / English”, and it takes effect in every tab immediately.
  5. Esc to cancel and change nothing.
Is the list empty?

Then Erya cannot find the keymap/ directory. Point ERYA_KEYMAPS_DIR at wherever it is (see 1.2.7) — the usual cause is unpacking only the executable from a release archive.

4.1.4

The keymap editor

Change bindings inside Erya, then save them as your own TOML.

爾雅 Erya │ Keymap editor │ Erya Terminal Safe
↑/↓ Select Enter Edit Delete Disable S Save as Esc Back
Save the document Ctrl+S Save the document under another name F12 Exit Erya Ctrl+X Capture the selection or current line as a phrase Insert the next saved phrase Fill the block selection with a character
Erya Terminal Safe │ 32/62
Select an action and press Enter to edit; press S to save as a new file
KeyWhat it does
↑ ↓Choose an action. Description on the left, current keys on the right (blank means unbound).
EnterEdit this action's keys. The input is pre-filled; separate several keys with commas.
DeleteDisable it (the same as leaving it blank): “Disabled shortcuts for the selected action”.
SSave the whole profile as a new TOML file.
EscBack to system settings.
  • Keys that cannot be parsed, or that clash with another action, give “Could not update keymap: …” and nothing changes.
  • Saving asks for a filename and confirms with “Saved keymap as …”.
  • Save As never overwrites an existing file. An existing name fails rather than quietly replacing someone else's profile.
Making your profile the one you always get

Two options: save it into the keymap/ directory so F2 can list it, or put it at the platform's default path (see 4.1.7) so Erya loads it on every start.

4.1.5

What the file looks like

A name and a [bindings] section.

Start from a file that lists every action:

erya --print-default-keymap > keymap.toml

Example
name = "My profile"

[bindings]
save = "Alt+S"
quit = "Ctrl+X"
search = ["Ctrl+W", "Ctrl+F"]
toggle_rectangular_selection = "Alt+M"
redo = []
  • An action can have several keys: write an array.
  • An empty array [] disables the action.
  • Anything you leave out keeps its default. To change two keys, the file needs only those two lines.
  • name is what appears in system settings and in row 1 of the keymap editor.
  • The complete list of action names is in 4.4, or in the output of --print-default-keymap.
4.1.6

How to write key names

Join modifiers with +; case does not matter.

CategoryAccepted names
ModifiersCtrl, Alt, Shift, Super, Hyper, Meta
Ordinary charactersA–Z, 0–9, punctuation
Function keysF1 to F24
Navigation and editingLeft, Right, Up, Down, Home, End, PageUp, PageDown, Insert, Delete, Backspace, Tab, Enter, Esc

Examples: "Ctrl+S", "Alt+Shift+Right", "F12", "ctrl+shift+f" (case-insensitive).

F1 cannot be bound

Plain F1 is reserved for keyboard help, and putting it in a config file is an error (see 1.3.8). It is the deliberate escape hatch: whatever a profile does to the rest, one key still lists everything.

4.1.7

Where the file has to live

Three ways to point at one, highest priority first.

  1. --keymap <file> — this run only, and it wins.
  2. The ERYA_KEYMAP environment variable — used when there is no --keymap.
  3. The platform default path — consulted when neither of the above is set:
PlatformPath
macOS~/Library/Application Support/Erya/keymap.toml
Linux$XDG_CONFIG_HOME/erya/keymap.toml, or ~/.config/erya/keymap.toml when XDG is unset
Windows%APPDATA%\Erya\keymap.toml
No file at the default path is perfectly normal

Erya does not create one. If it is missing, the built-in defaults are used with no warning at all. A path you named explicitly with --keymap or ERYA_KEYMAP does produce a message when it cannot be read — because you said you wanted it.

4.1.8

Conflicts and the fallback

A broken profile does not stop the program; it just is not used.

Could not load key bindings; using defaults: save and search are both bound to F9
  1. Two actions on one key — a conflict, because Erya cannot decide which to run.
  2. A misspelled key name or invalid TOML — a parse failure.
  3. Plain F1 bound to an action — reserved, and refused.

In each case Erya falls back to the complete default profile — not “ignore the bad line” — and explains why in the message row at startup. The program still runs.

Checking which profile you are actually using

Look at the hint bar on row 2 (it shows real keys), press F1 for the full list, or press F2 and read the profile name. All three tell you the truth.

4.1.9

Common problems

Seven situations when changing keys.

SymptomCause and fix
You edited the file and nothing changedIt is not where Erya looks (4.1.7), or it was rejected and the defaults took over (4.1.8). Read the startup message.
“Could not load key bindings” at startupA conflict or a syntax error; the reason follows the colon (4.1.8).
F2 lists no profilesThe keymap/ directory was not found. Set ERYA_KEYMAPS_DIR (4.1.3).
An Alt binding does nothingThe terminal is not sending Option/Alt as Meta. Bind something else, or enable it in the terminal (4.1.1).
Binding F1 is refusedF1 is reserved (4.1.6).
Save As failsThe filename exists. Erya never overwrites; choose another (4.1.4).
After switching, undo deletes a lineCtrl+Y means different things in the two profiles (4.1.2).