From 42e2d14e5e82f0c12ce9e9fd9e42a7e0a3f64e34 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Thu, 23 Oct 2025 14:52:46 +0100 Subject: [PATCH] feat(keybindings): enhance navigation and terminal pane focus keybindings for improved workflow --- .../vscode-keybinding-workarounds.json | 54 ++++++++++++++++++- keybindings.json | 38 +++++++++++-- 2 files changed, 88 insertions(+), 4 deletions(-) diff --git a/karabiner-elements/vscode-keybinding-workarounds.json b/karabiner-elements/vscode-keybinding-workarounds.json index 84d4965..c4027b5 100644 --- a/karabiner-elements/vscode-keybinding-workarounds.json +++ b/karabiner-elements/vscode-keybinding-workarounds.json @@ -27,6 +27,58 @@ ], "type": "basic" }, + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.exafunction\\.windsurf", + "^com\\.microsoft\\.VSCode", + "^com\\.todesktop\\." + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "l", + "modifiers": { + "mandatory": ["option"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": ["left_option", "left_command"] + } + ], + "type": "basic" + }, + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.exafunction\\.windsurf", + "^com\\.microsoft\\.VSCode", + "^com\\.todesktop\\." + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "j", + "modifiers": { + "mandatory": ["option"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": ["left_option", "left_command"] + } + ], + "type": "basic" + }, { "conditions": [ { @@ -74,7 +126,7 @@ "to": [ { "key_code": "right_arrow", - "modifiers": ["left_option", "left_command"] + "modifiers": ["left_option", "left_command", "shift"] } ], "type": "basic" diff --git a/keybindings.json b/keybindings.json index 31e9227..c09498f 100644 --- a/keybindings.json +++ b/keybindings.json @@ -312,11 +312,23 @@ }, { // Navigate right. "key": "alt+l", - "command": "workbench.action.navigateRight" + "command": "workbench.action.navigateRight", + "when": "!panelFocus" + }, + { // Navigate right. + "key": "cmd+alt+right", + "command": "workbench.action.navigateRight", + "when": "!panelFocus" }, { // Navigate left. "key": "alt+j", - "command": "workbench.action.navigateLeft" + "command": "workbench.action.navigateLeft", + "when": "!panelFocus" + }, + { // Navigate left. + "key": "cmd+alt+left", + "command": "workbench.action.navigateLeft", + "when": "!panelFocus" }, { // Navigate down. "key": "alt+k", @@ -335,6 +347,26 @@ "command": "workbench.action.focusActiveEditorGroup", "when": "panelFocus" }, + { // Focus next terminal pane. + "key": "alt+l", + "command": "workbench.action.terminal.focusNextPane", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { // Focus next terminal pane. + "key": "cmd+alt+right", + "command": "workbench.action.terminal.focusNextPane", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { // Focus previous terminal pane. + "key": "alt+j", + "command": "workbench.action.terminal.focusPreviousPane", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { // Focus previous terminal pane. + "key": "cmd+alt+left", + "command": "workbench.action.terminal.focusPreviousPane", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, // // =========================================================================== // MARK: Searching @@ -514,7 +546,7 @@ // // This is a workaround for alt+e not working in VSCode. Relies on // Karabiner-Elements to remap alt+e to cmd+alt+right. - "key": "cmd+alt+right", + "key": "cmd+shift+alt+right", "command": "emacs-mcx.forwardParagraph", "when": "editorTextFocus && !suggestWidgetVisible" },