Skip to content

Commit 3e9c921

Browse files
authored
Add vim-style Ctrl+Shift+h/j/k/l block navigation and move launcher shortcut from Ctrl+Shift+k to Ctrl+Shift+x (#2909)
## Summary This PR adds vim-style movement aliases for block navigation and updates one conflicting shortcut. ## Changes - Added global keybindings: - `Ctrl+Shift+h` -> move focus left - `Ctrl+Shift+j` -> move focus down - `Ctrl+Shift+k` -> move focus up - `Ctrl+Shift+l` -> move focus right - Kept existing arrow-based movement: - `Ctrl+Shift+ArrowUp/Down/Left/Right` - **Changed launcher shortcut**: - from `Ctrl+Shift+k` - to `Ctrl+Shift+x` ## Why `k` changed to `x` `Ctrl+Shift+k` is now used for vim-style upward movement (`k` = up), so launcher replace needed a new binding. `Ctrl+Shift+x` was chosen to avoid collisions with existing Wave global keybindings. ## Config / behavior notes - `app:disablectrlshiftarrows` now disables both block-navigation sets: - Arrow keys - `h/j/k/l` aliases - It does **not** disable `Ctrl+Shift+x` (launcher replace). ## Docs updated - `docs/docs/keybindings.mdx` - Added `Ctrl+Shift+h/j/k/l` navigation display - Updated launcher replace shortcut to `Ctrl+Shift+x` - `docs/docs/config.mdx` - Clarified `app:disablectrlshiftarrows` scope to include `Arrow` + `h/j/k/l`
1 parent e8d4cdd commit 3e9c921

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

docs/docs/config.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ wsh editconfig
4141
| app:ctrlvpaste | bool | On Windows/Linux, when null (default) uses Control+V on Windows only. Set to true to force Control+V on all non-macOS platforms, false to disable the accelerator. macOS always uses Command+V regardless of this setting |
4242
| app:confirmquit <VersionBadge version="v0.14" /> | bool | Set to false to disable the quit confirmation dialog when closing Wave Terminal (defaults to true, requires app restart) |
4343
| app:hideaibutton <VersionBadge version="v0.14" /> | bool | Set to true to hide the AI button in the tab bar (defaults to false) |
44-
| app:disablectrlshiftarrows <VersionBadge version="v0.14" /> | bool | Set to true to disable Ctrl+Shift+Arrow keybindings for block navigation (defaults to false) |
44+
| app:disablectrlshiftarrows <VersionBadge version="v0.14" /> | bool | Set to true to disable Ctrl+Shift block-navigation keybindings (`Arrow` and `h/j/k/l`) (defaults to false) |
4545
| app:disablectrlshiftdisplay <VersionBadge version="v0.14" /> | bool | Set to true to disable the Ctrl+Shift visual indicator display (defaults to false) |
4646
| ai:preset | string | the default AI preset to use |
4747
| ai:baseurl | string | Set the AI Base Url (must be OpenAI compatible) |

docs/docs/keybindings.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ Chords are shown with a + between the keys. You have 2 seconds to hit the 2nd ch
4242
| <Kbd k="Ctrl:Shift"/> | Show block numbers |
4343
| <Kbd k="Ctrl:Shift:0"/> | Focus WaveAI input |
4444
| <Kbd k="Ctrl:Shift:1-9"/> | Switch to block number |
45-
| <Kbd k="Ctrl:Shift:Arrows"/> | Move left, right, up, down between blocks |
46-
| <Kbd k="Ctrl:Shift:k"/> | Replace the current block with a launcher block |
45+
| <Kbd k="Ctrl:Shift:Arrows"/> / <Kbd k="Ctrl:Shift:h/j/k/l"/> | Move left, right, up, down between blocks |
46+
| <Kbd k="Ctrl:Shift:x"/> | Replace the current block with a launcher block |
4747
| <Kbd k="Cmd:1-9"/> | Switch to tab number |
4848
| <Kbd k="Cmd:["/> / <Kbd k="Shift:Cmd:["/> | Switch tab left |
4949
| <Kbd k="Cmd:]"/> / <Kbd k="Shift:Cmd:]"/> | Switch tab right |

frontend/app/store/keymodel.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,40 @@ function registerGlobalKeys() {
585585
switchBlockInDirection(NavigateDirection.Right);
586586
return true;
587587
});
588+
// Vim-style aliases for block focus navigation.
589+
globalKeyMap.set("Ctrl:Shift:h", () => {
590+
const disableCtrlShiftArrows = globalStore.get(getSettingsKeyAtom("app:disablectrlshiftarrows"));
591+
if (disableCtrlShiftArrows) {
592+
return false;
593+
}
594+
switchBlockInDirection(NavigateDirection.Left);
595+
return true;
596+
});
597+
globalKeyMap.set("Ctrl:Shift:j", () => {
598+
const disableCtrlShiftArrows = globalStore.get(getSettingsKeyAtom("app:disablectrlshiftarrows"));
599+
if (disableCtrlShiftArrows) {
600+
return false;
601+
}
602+
switchBlockInDirection(NavigateDirection.Down);
603+
return true;
604+
});
588605
globalKeyMap.set("Ctrl:Shift:k", () => {
606+
const disableCtrlShiftArrows = globalStore.get(getSettingsKeyAtom("app:disablectrlshiftarrows"));
607+
if (disableCtrlShiftArrows) {
608+
return false;
609+
}
610+
switchBlockInDirection(NavigateDirection.Up);
611+
return true;
612+
});
613+
globalKeyMap.set("Ctrl:Shift:l", () => {
614+
const disableCtrlShiftArrows = globalStore.get(getSettingsKeyAtom("app:disablectrlshiftarrows"));
615+
if (disableCtrlShiftArrows) {
616+
return false;
617+
}
618+
switchBlockInDirection(NavigateDirection.Right);
619+
return true;
620+
});
621+
globalKeyMap.set("Ctrl:Shift:x", () => {
589622
const blockId = getFocusedBlockId();
590623
if (blockId == null) {
591624
return true;

0 commit comments

Comments
 (0)