Skip to content

feat(keybindings): in-app keybinding editor (leader+k)#234

Merged
Maxteabag merged 1 commit into
mainfrom
feat/keybinding-editor
May 25, 2026
Merged

feat(keybindings): in-app keybinding editor (leader+k)#234
Maxteabag merged 1 commit into
mainfrom
feat/keybinding-editor

Conversation

@Maxteabag
Copy link
Copy Markdown
Owner

Adds an in-app keybinding editor accessible via <space>k. Lists every binding (default or user-overridden), lets you rebind by pressing a new key, revert one to default, or wipe all overrides. Edits write to ~/.config/sqlit/keymap.json and apply live — no restart.

Two additional cleanups bundled in because the editor exposed both:

  • Drops the custom_keymap named-keymap setting and ~/.config/sqlit/keymaps/ directory. There's one keymap file now (auto-scaffolded), which makes the editor's write path unambiguous.
  • Conflict detection now catches ancestor shadows — e.g. binding ? in query_normal would silently shadow the global show_help. The detector walks the same State.parent chain the runtime resolver uses (each State subclass now carries a keymap_context class attribute), so there's no parallel hierarchy table.

Adds a keybinding editor that lists every default + user-overridden
binding, lets the user rebind one by pressing a key, revert one to
default, or wipe every override — writes flow through keymap.json
and apply live via set_keymap().

Also drops the named-keymap mechanism in favour of a single
~/.config/sqlit/keymap.json so the editor has one obvious place to
write to, and tightens conflict detection to catch ancestor shadows
(e.g. binding "?" in query_normal would silently shadow the global
show_help binding). The shadow detector reuses the state-machine
hierarchy: each State subclass carries a keymap_context name, and
keymap_manager walks State.parent to derive the ancestor chain — no
parallel hierarchy table to keep in sync.
@Maxteabag Maxteabag merged commit 97d70c4 into main May 25, 2026
20 of 21 checks passed
@Maxteabag Maxteabag deleted the feat/keybinding-editor branch May 25, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant