feat: add custom keybindings support with VSCode-style configuration#3142
Draft
mswiszcz wants to merge 7 commits intowavetermdev:mainfrom
Draft
feat: add custom keybindings support with VSCode-style configuration#3142mswiszcz wants to merge 7 commits intowavetermdev:mainfrom
mswiszcz wants to merge 7 commits intowavetermdev:mainfrom
Conversation
Refactor keybindings into a declarative action registry with user override support via keybindings.json. Includes JSON schema, config sidebar entry, documentation, and Go backend support for reading keybindings config.
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…-style last-wins resolution globalKeyMap and globalChordMap were Maps but checkKeyMap already iterated linearly over all entries (no O(1) lookup benefit). Switching to arrays with reverse iteration gives natural "last entry wins" semantics — user overrides appended after defaults automatically shadow them without explicit merge logic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add block:focusnext (Ctrl+Shift+]) and block:focusprev (Ctrl+Shift+[) to cycle focus through blocks in leaf order - Lowercase all keybinding command IDs to match settings.json conventions (e.g. block:splitRight → block:splitright, app:toggleAIPanel → app:toggleaipanel) - Update schema and docs to reflect both changes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Both unbinding mechanisms now work:
- "-block:close" prefix removes all default keys for that command
- { key: null, command: "block:close" } does the same thing
Both append null-handler entries that shadow defaults via reverse iteration.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add app:settings keybinding (Cmd+,) to open settings block - Fix config editor rejecting keybindings.json save because it requires JSON objects — keybindings.json is an array by design. Added allowArray flag to ConfigFile type. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Users can now write "cmd:[" instead of "Cmd:[" in keybindings.json. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Edit: Discussed, this is going to be first iteration of keybindings support. Following VS Code guidelines. We will add chords and streamline keybindings to follow vs code format in next PRs.
This remains a draft until I manually verify if it's working properly and have a deep dive through the code.
Refactor keybindings into a declarative action registry with user override support via keybindings.json. Includes JSON schema, config sidebar entry, documentation, and Go backend support for reading keybindings config.