Skip to content

Instantly share code, notes, and snippets.

@Pitasi
Last active January 7, 2022 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pitasi/3cab0b150cdb2900a127928dd2cd6c86 to your computer and use it in GitHub Desktop.
Save Pitasi/3cab0b150cdb2900a127928dd2cd6c86 to your computer and use it in GitHub Desktop.
Mac OS Karabiner rule for remapping Caps Lock to Command and Escape
{
"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"
]
}
]
}
]
}
]
}
@Pitasi
Copy link
Author

Pitasi commented Jan 7, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment