Last active
January 7, 2022 17:09
-
-
Save Pitasi/3cab0b150cdb2900a127928dd2cd6c86 to your computer and use it in GitHub Desktop.
Mac OS Karabiner rule for remapping Caps Lock to Command and Escape
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
{ | |
"title": "CapsLock -> Cmd/Ctrl based on current app", | |
"rules": [ | |
{ | |
"description": "CapsLock -> Cmd/Ctrl based on current app", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "caps_lock", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "left_command" | |
} | |
], | |
"to_if_alone": [ | |
{ | |
"key_code": "escape" | |
} | |
], | |
"conditions": [ | |
{ | |
"type": "frontmost_application_unless", | |
"bundle_identifiers": [ | |
"^com\\.microsoft\\.VSCode", | |
"^net\\.kovidgoyal\\.kitty" | |
] | |
} | |
] | |
}, | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "caps_lock", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "left_control" | |
} | |
], | |
"to_if_alone": [ | |
{ | |
"key_code": "escape" | |
} | |
], | |
"conditions": [ | |
{ | |
"type": "frontmost_application_if", | |
"bundle_identifiers": [ | |
"^com\\.microsoft\\.VSCode", | |
"^net\\.kovidgoyal\\.kitty" | |
] | |
} | |
] | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I edited it to map Caps Lock to Ctrl in VS Code and Kitty (my terminal emulator), while mapping Caps Lock to Command in the other apps. It feels much more natural for me, coming from Linux.