Skip to content

Instantly share code, notes, and snippets.

@yspreen
Created April 20, 2018 16:58
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 yspreen/61c2f9f645f7604e8647910da9216ddc to your computer and use it in GitHub Desktop.
Save yspreen/61c2f9f645f7604e8647910da9216ddc to your computer and use it in GitHub Desktop.
Karabiner configuration for Windows keyboard features
{
"title": "PC Style",
"rules": [
{
"description": "Home / End (except Chrome, Code, iTerm, Terminal and vim)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "home"
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"left_command"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2",
"^com.microsoft.VSCode",
"^com.google.Chrome",
"^com.apple.Terminal"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "home",
"modifiers": {
"mandatory": [
"left_shift"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"left_command",
"left_shift"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2",
"^com.microsoft.VSCode",
"^com.google.Chrome",
"^com.apple.Terminal"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "end"
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"left_command"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2",
"^com.microsoft.VSCode",
"^com.google.Chrome",
"^com.apple.Terminal"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "end",
"modifiers": {
"mandatory": [
"left_shift"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"left_command",
"left_shift"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2",
"^com.microsoft.VSCode",
"^com.google.Chrome",
"^com.apple.Terminal"
]
}
]
}
]
},
{
"description": "Ctrl + Left/Right (except Chrome, Code, iTerm, Terminal and vim)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "delete_or_backspace",
"modifiers": {
"mandatory": [
"left_command"
]
}
},
"to": [
{
"key_code": "delete_or_backspace",
"modifiers": [
"left_control"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2",
"^com.microsoft.VSCode",
"^com.google.Chrome",
"^com.apple.Terminal"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": [
"left_command"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"left_control"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2",
"^com.microsoft.VSCode",
"^com.google.Chrome",
"^com.apple.Terminal"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "left_arrow",
"modifiers": {
"mandatory": [
"left_command",
"left_shift"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"left_control",
"left_shift"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2",
"^com.microsoft.VSCode",
"^com.google.Chrome",
"^com.apple.Terminal"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": [
"left_command",
"left_shift"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"left_control",
"left_shift"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^org\\.vim\\.",
"^com.googlecode.iterm2",
"^com.microsoft.VSCode",
"^com.google.Chrome",
"^com.apple.Terminal"
]
}
]
}
]
},
{
"description": "Ctrl + Left/Right (Chrome, Code)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "delete_or_backspace",
"modifiers": {
"mandatory": [
"left_command"
]
}
},
"to": [
{
"key_code": "delete_or_backspace",
"modifiers": [
"left_option"
]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com.microsoft.VSCode",
"^com.google.Chrome"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "left_arrow",
"modifiers": {
"mandatory": [
"left_command"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"left_option"
]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com.microsoft.VSCode",
"^com.google.Chrome"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": [
"left_command"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"left_option"
]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com.microsoft.VSCode",
"^com.google.Chrome"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "left_arrow",
"modifiers": {
"mandatory": [
"left_command",
"left_shift"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"left_option",
"left_shift"
]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com.microsoft.VSCode",
"^com.google.Chrome"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": [
"left_command",
"left_shift"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"left_option",
"left_shift"
]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com.microsoft.VSCode",
"^com.google.Chrome"
]
}
]
}
]
},
{
"description": "Fix Cmd+Tab",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "tab",
"modifiers": {
"mandatory": [
"left_option"
],
"optional": [
"left_shift"
]
}
},
"to": [
{
"key_code": "tab",
"modifiers": [
"left_command"
]
}
]
}
]
},
{
"description": "Fix Chrome Navigation",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_arrow",
"modifiers": {
"mandatory": [
"left_option"
]
}
},
"to": [
{
"key_code": "8",
"modifiers": [
"left_command",
"left_option"
]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com.google.Chrome"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": [
"left_option"
]
}
},
"to": [
{
"key_code": "9",
"modifiers": [
"left_command",
"left_option"
]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com.google.Chrome"
]
}
]
}
]
},
{
"description": "Home / End (Terminal)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "home"
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"left_shift",
"fn"
]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com.apple.Terminal"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "end"
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"left_shift",
"fn"
]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com.apple.Terminal"
]
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment