Skip to content

Instantly share code, notes, and snippets.

@fujii
Last active October 4, 2017 06:04
Show Gist options
  • Save fujii/c77b51d62947bb318389d925dbaf2224 to your computer and use it in GitHub Desktop.
Save fujii/c77b51d62947bb318389d925dbaf2224 to your computer and use it in GitHub Desktop.
Karabiner-Elements
{
"title": "Fujihiro",
"rules": [
{
"description": "Swap command and control in Terminal and Emacs",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_control",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_command"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyperterm$",
"^co\\.zeit\\.hyper$",
"^org\\.gnu\\.Emacs$",
"com\\.microsoft\\.rdc\\.mac"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "left_command",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_control"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyperterm$",
"^co\\.zeit\\.hyper$",
"^org\\.gnu\\.Emacs$",
"com\\.microsoft\\.rdc\\.mac"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "right_control",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_command"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyperterm$",
"^co\\.zeit\\.hyper$",
"^org\\.gnu\\.Emacs$",
"com\\.microsoft\\.rdc\\.mac"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "right_command",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_control"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyperterm$",
"^co\\.zeit\\.hyper$",
"^org\\.gnu\\.Emacs$",
"com\\.microsoft\\.rdc\\.mac"
]
}
]
}
]
},
{
"description": "Change Command+Tab to Control+Tab",
"manipulators": [
{
"from": {
"key_code": "tab",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "tab",
"modifiers": [
"control"
]
}
],
"type": "basic"
}
]
},
{
"description": "Change Option+Tab to Command+Tab",
"manipulators": [
{
"from": {
"key_code": "tab",
"modifiers": {
"mandatory": [
"option"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "tab",
"modifiers": [
"command"
]
}
],
"type": "basic"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment