Skip to content

Instantly share code, notes, and snippets.

@sxlijin
Created June 5, 2024 19:52
Show Gist options
  • Save sxlijin/64ab2afe7e95ac06187801f4ed21c81b to your computer and use it in GitHub Desktop.
Save sxlijin/64ab2afe7e95ac06187801f4ed21c81b to your computer and use it in GitHub Desktop.
karabiner-elements rules
{
"description": "In Terminal/VSCode, caps_lock is CTRL",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Terminal",
"^com\\.googlecode\\.iterm2",
"^com\\.microsoft\\.VSCode"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "left_command"
},
"to": [
{
"key_code": "left_control"
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Terminal",
"^com\\.googlecode\\.iterm2",
"^com\\.microsoft\\.VSCode"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "tab",
"modifiers": {
"mandatory": [
"control"
]
}
},
"to": [
{
"key_code": "tab",
"modifiers": [
"command"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Terminal",
"^com\\.googlecode\\.iterm2",
"^com\\.microsoft\\.VSCode"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "tab",
"modifiers": {
"mandatory": [
"control",
"shift"
]
}
},
"to": [
{
"key_code": "tab",
"modifiers": [
"command",
"shift"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Terminal",
"^com\\.googlecode\\.iterm2",
"^com\\.microsoft\\.VSCode"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "spacebar",
"modifiers": {
"mandatory": [
"control"
]
}
},
"to": [
{
"key_code": "spacebar",
"modifiers": [
"command"
]
}
],
"type": "basic"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment