Feature: Custom Keybindings#131
Conversation
Implements user-facing JSON keymap configuration following the ThemeManager pattern. Users can now customize all keybindings by creating JSON files in ~/.sqlit/keymaps/ and setting custom_keymap in settings.json. Features: - KeymapManager class for loading/validating custom keymaps - FileBasedKeymapProvider implementing KeymapProvider interface - JSON structure with leader_commands and action_keys arrays - Graceful error handling (invalid configs don't crash app) - Comprehensive test suite (11 tests covering all scenarios) - User documentation with examples and troubleshooting - Template keymap showing all default bindings Integration: - Loads during app startup after theme initialization - Settings key: custom_keymap (default/name) - Directory: ~/.sqlit/keymaps/ - Follows established sqlit configuration patterns Files: - sqlit/core/keymap_manager.py: Manager implementation - config/keymap.template.json: User template with examples - docs/custom-keymaps.md: Complete user guide - tests/ui/keybindings/test_keymap_manager.py: Test coverage This enables power users to customize keybindings per CONTRIBUTING.md line 243 which explicitly permits keyboard binding customization.
|
Files you can use as keymaps: https://gist.github.com/xtrasmal/1c15deb40b0caeaae0740648b802b4d9 |
|
I would love this feature, especially since the auto-compeltion I prefer C-N / C-P as selection and C-K as accepting selection. |
|
Oh this is incredible. Custom keybindings are the only thing preventing me from fully switching over to +1'ing in hopes this PR sees a merge and release. 🙏 |
|
Great idea, thanks. @xtrasmal I think it would make more sense if the custom keymap was additive, meaning you only replace the keymaps of the JSON you've configured. So that you don't need to paste in the entire JSON just to replace one or two keybindings. I would like to see that the keyhints in the footer and the help menu reflect the custom keybindings too. Let me know what you think. |
Builds on Maxteabag#131 by xtrasmal. Overrides now merge over the defaults rather than replacing the whole map, the footer and help screen reflect custom keys, and a config with conflicting bindings is rejected at startup. Also wires more screens (value view, autocomplete, connection editor, etc.) into the keymap so user overrides actually take effect there too. Co-authored-by: Xander <1174877+xtrasmal@users.noreply.github.com>
Implements user-facing JSON keymap configuration following the ThemeManager pattern. Users can now customize all keybindings by creating JSON files in ~/.sqlit/keymaps/ and setting custom_keymap in settings.json.
Features:
Integration:
Files:
This enables power users to customize keybindings per CONTRIBUTING.md line 243 which explicitly permits keyboard binding customization.