Skip to content

Instantly share code, notes, and snippets.

@akaita
Created March 1, 2019 11:28
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 akaita/34efb6401cd3b4e2f1b07cb35591b3d9 to your computer and use it in GitHub Desktop.
Save akaita/34efb6401cd3b4e2f1b07cb35591b3d9 to your computer and use it in GitHub Desktop.
Karabiner - PC-style for MacOs: Home, End and Undo
# ~/.config/karabiner/assets/complex_modifications/windows-binding.json
{
"title": "Windows keys",
"rules": [
{
"description": "swap control/command fix home/end/redo except for iterm2/vim",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "y",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": [
{
"key_code": "z",
"modifiers": [
"command",
"shift"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "end"
},
"to": [
{
"key_code": "e",
"modifiers": [
"control"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "home"
},
"to": [
{
"key_code": "a",
"modifiers": [
"control"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "left_command"
},
"to": [
{
"key_code": "left_control"
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "left_control"
},
"to": [
{
"key_code": "left_command"
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "right_command"
},
"to": [
{
"key_code": "right_control"
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "right_control"
},
"to": [
{
"key_code": "right_command"
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "end",
"modifiers": {
"mandatory": [
"shift"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"command",
"shift"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "home",
"modifiers": {
"mandatory": [
"shift"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"command",
"shift"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2"
]
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment