User guide / Custom key bindings

How bindings are resolved

Development reference · View source

  • After remapping. keys.bind sees the keyboard as keys.rebind and the prefixes left it. Left sides are final key sequences, and Leader and Window expand to the configured prefixes.
  • Exact replacement. Assigning a key replaces whatever global action it had in that mode.
  • No actions on prefixes. Assigning an action to a prefix that still has keys under it is an error.
  • Reserved keys. In Normal and Select, a leading 1–9 is still a count and Tab still opens context actions. Escape and Backspace cannot appear inside a sequence. Named prefixes and keys.rebind must respect these reservations too; unreachable remappings are rejected and retain their working defaults.
  • Scoped input wins. Buffer-specific keys, prompts, lists, native confirmations, and terminal input keep handling their own keys.