feat(cursor): numerious improvements to alt/ctrl keybindings via karabiner

This commit is contained in:
Jim Myhrberg
2025-03-05 19:33:26 +00:00
parent 79b82d6ce9
commit 5a33d6e345
3 changed files with 419 additions and 113 deletions

View File

@@ -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

View File

@@ -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"
}
]
}

View File

@@ -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"
}
]
}