diff --git a/cursor/keybindings.json b/cursor/keybindings.json index 327f6ea..1ddf787 100644 --- a/cursor/keybindings.json +++ b/cursor/keybindings.json @@ -38,6 +38,14 @@ "key": "ctrl+z ctrl+n", "command": "workbench.action.showNextWindowTab" }, + { // Go to next window tab. + // + // This is a workaround for ctrl+n not working globally as down arrow in + // all input fields. This relies on Karabiner-Elements to remap ctrl+n to + // down arrow. + "key": "ctrl+z down", + "command": "workbench.action.showNextWindowTab" + }, { // Go to next window tab. "key": "shift+cmd+]", "command": "workbench.action.showNextWindowTab" @@ -183,8 +191,8 @@ }, { // Navigate up. // - // Workaround for alt+i not working in VSCode. Relies on - // Karabiner-Elements to remap alt+i to cmd+alt+up. + // Workaround for alt+i not working in VSCode. Relies on Karabiner-Elements + // to remap alt+i to cmd+alt+up. "key": "cmd+alt+up", "command": "workbench.action.navigateUp" }, @@ -251,8 +259,9 @@ "command": "workbench.action.moveEditorToAboveGroup" }, { // Move active editor into group above. - // Workaround for alt+i not working in VSCode. Relies on - // Karabiner-Elements to remap alt+i to cmd+alt+up. + // + // Workaround for alt+i not working in VSCode. Relies on Karabiner-Elements + // to remap alt+i to cmd+alt+up. "key": "cmd+alt+shift+up", "command": "workbench.action.moveEditorToAboveGroup" }, @@ -275,13 +284,11 @@ // { // Undo. "key": "alt+-", - "command": "undo", - "when": "editorTextFocus && !editorReadonly" + "command": "undo" }, { // Redo. - "key": "shift+alt+-", - "command": "redo", - "when": "editorTextFocus && !editorReadonly" + "key": "alt+shift+-", + "command": "redo" }, // // =========================================================================== @@ -430,6 +437,14 @@ "key": "ctrl+x ctrl+d", "command": "editor.action.duplicateSelection" }, + { // Duplicate selection. + // + // This is a workaround for ctrl+d not working globally as forward delete in + // all input fields. This relies on Karabiner-Elements to remap ctrl+d to + // forward delete. + "key": "ctrl+x delete", + "command": "editor.action.duplicateSelection" + }, { // Rename thing at point. "key": "ctrl+c ctrl+.", "command": "editor.action.rename", @@ -630,6 +645,14 @@ "key": "ctrl+c ctrl+d", "command": "editor.action.triggerParameterHints" }, + { // Show documentation for symbol at cursor. + // + // This is a workaround for ctrl+d not working globally as forward delete in + // all input fields. Hence we rebind ctrl+d to forward delete, meaning any + // keybindings that use ctrl+d need to be updated to use delete aswell. + "key": "ctrl+c delete", + "command": "editor.action.triggerParameterHints" + }, // // =========================================================================== // MARK: edamagit diff --git a/karabiner/vscode-alt-keybindings-workaround.json b/karabiner/vscode-alt-keybindings-workaround.json deleted file mode 100644 index 417cfc0..0000000 --- a/karabiner/vscode-alt-keybindings-workaround.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "description": "VSCode alt keybindings workaround", - "manipulators": [ - { - "conditions": [ - { - "bundle_identifiers": [ - "^com\\.microsoft\\.VSCode", - "^com\\.todesktop\\." - ], - "type": "frontmost_application_if" - } - ], - "from": { - "key_code": "i", - "modifiers": { - "mandatory": [ - "option" - ], - "optional": [ - "caps_lock", - "shift" - ] - } - }, - "to": [ - { - "key_code": "up_arrow", - "modifiers": [ - "left_option", - "left_command" - ] - } - ], - "type": "basic" - }, - { - "conditions": [ - { - "bundle_identifiers": [ - "^com\\.microsoft\\.VSCode", - "^com\\.todesktop\\." - ], - "type": "frontmost_application_if" - } - ], - "from": { - "key_code": "n", - "modifiers": { - "mandatory": [ - "option" - ], - "optional": [ - "caps_lock", - "shift" - ] - } - }, - "to": [ - { - "key_code": "down_arrow", - "modifiers": [ - "left_option", - "left_command" - ] - } - ], - "type": "basic" - }, - { - "conditions": [ - { - "bundle_identifiers": [ - "^com\\.microsoft\\.VSCode", - "^com\\.todesktop\\." - ], - "type": "frontmost_application_if" - } - ], - "from": { - "key_code": "e", - "modifiers": { - "mandatory": [ - "option" - ], - "optional": [ - "caps_lock", - "shift" - ] - } - }, - "to": [ - { - "key_code": "right_arrow", - "modifiers": [ - "left_option", - "left_command" - ] - } - ], - "type": "basic" - } - ] -} diff --git a/karabiner/vscode-keybinding-workarounds.json b/karabiner/vscode-keybinding-workarounds.json new file mode 100644 index 0000000..080b332 --- /dev/null +++ b/karabiner/vscode-keybinding-workarounds.json @@ -0,0 +1,387 @@ +{ + "description": "VSCode keybinding workarounds", + "manipulators": [ + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.microsoft\\.VSCode", + "^com\\.todesktop\\." + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "i", + "modifiers": { + "mandatory": [ + "option" + ], + "optional": [ + "caps_lock", + "shift" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "left_option", + "left_command" + ] + } + ], + "type": "basic" + }, + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.microsoft\\.VSCode", + "^com\\.todesktop\\." + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "n", + "modifiers": { + "mandatory": [ + "option" + ], + "optional": [ + "caps_lock", + "shift" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "left_option", + "left_command" + ] + } + ], + "type": "basic" + }, + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.microsoft\\.VSCode", + "^com\\.todesktop\\." + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "e", + "modifiers": { + "mandatory": [ + "option" + ], + "optional": [ + "caps_lock", + "shift" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "left_option", + "left_command" + ] + } + ], + "type": "basic" + }, + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.microsoft\\.VSCode", + "^com\\.todesktop\\." + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "f", + "modifiers": { + "mandatory": [ + "option" + ], + "optional": [ + "caps_lock", + "shift" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [ + "left_option" + ] + } + ], + "type": "basic" + }, + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.microsoft\\.VSCode", + "^com\\.todesktop\\." + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "b", + "modifiers": { + "mandatory": [ + "option" + ], + "optional": [ + "caps_lock", + "shift" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [ + "left_option" + ] + } + ], + "type": "basic" + }, + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.microsoft\\.VSCode", + "^com\\.todesktop\\." + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "d", + "modifiers": { + "mandatory": [ + "option" + ], + "optional": [ + "caps_lock", + "shift" + ] + } + }, + "to": [ + { + "key_code": "delete_forward", + "modifiers": [ + "left_option" + ] + } + ], + "type": "basic" + }, + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.microsoft\\.VSCode", + "^com\\.todesktop\\." + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "hyphen", + "modifiers": { + "mandatory": [ + "option" + ], + "optional": [ + "caps_lock", + "shift" + ] + } + }, + "to": [ + { + "key_code": "z", + "modifiers": [ + "left_command" + ] + } + ], + "type": "basic" + }, + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.microsoft\\.VSCode", + "^com\\.todesktop\\." + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "hyphen", + "modifiers": { + "mandatory": [ + "option", + "shift" + ], + "optional": [ + "caps_lock" + ] + } + }, + "to": [ + { + "key_code": "z", + "modifiers": [ + "left_command", + "left_shift" + ] + } + ], + "type": "basic" + }, + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.microsoft\\.VSCode", + "^com\\.todesktop\\." + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "d", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "caps_lock", + "shift" + ] + } + }, + "to": [ + { + "key_code": "delete_forward" + } + ], + "type": "basic" + }, + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.microsoft\\.VSCode", + "^com\\.todesktop\\." + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "n", + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "caps_lock", + "shift" + ] + } + }, + "to": [ + { + "key_code": "down_arrow" + } + ], + "type": "basic" + }, + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.microsoft\\.VSCode", + "^com\\.todesktop\\." + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "comma", + "modifiers": { + "mandatory": [ + "option", + "shift" + ], + "optional": [ + "caps_lock" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [ + "left_command" + ] + } + ], + "type": "basic" + }, + { + "conditions": [ + { + "bundle_identifiers": [ + "^com\\.microsoft\\.VSCode", + "^com\\.todesktop\\." + ], + "type": "frontmost_application_if" + } + ], + "from": { + "key_code": "period", + "modifiers": { + "mandatory": [ + "option", + "shift" + ], + "optional": [ + "caps_lock" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [ + "left_command" + ] + } + ], + "type": "basic" + } + ] +}