feat(keybindings): in-app keybinding editor (leader+k)#234
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsonand apply live — no restart.Two additional cleanups bundled in because the editor exposed both:
custom_keymapnamed-keymap setting and~/.config/sqlit/keymaps/directory. There's one keymap file now (auto-scaffolded), which makes the editor's write path unambiguous.?inquery_normalwould silently shadow the globalshow_help. The detector walks the sameState.parentchain the runtime resolver uses (eachStatesubclass now carries akeymap_contextclass attribute), so there's no parallel hierarchy table.