Skip to content

Instantly share code, notes, and snippets.

@6david9
Created February 8, 2022 10:20
Show Gist options
  • Save 6david9/ee35d3b644e98c1d13e06879f576ea98 to your computer and use it in GitHub Desktop.
Save 6david9/ee35d3b644e98c1d13e06879f576ea98 to your computer and use it in GitHub Desktop.
custom shortcut for karabiner
{
"title": "Custom shortcut",
"maintainer": "ly",
"rules": [
{
"description": "format code in xcode",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "i",
"modifiers": {
"mandatory": [
"left_shift",
"left_control"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"left_command"
]
},
{
"key_code": "left_arrow",
"modifiers": [
"left_command"
]
},
{
"key_code": "delete_or_backspace",
"modifiers": [
"left_command"
]
},
{
"key_code": "delete_or_backspace"
},
{
"key_code": "spacebar"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.dt\\.Xcode$"
]
}
]
}
]
},
{
"description": "fold code in xcode",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "open_bracket",
"modifiers": {
"mandatory": [
"left_control"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"left_command",
"left_option"
]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.dt\\.Xcode$"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "close_bracket",
"modifiers": {
"mandatory": [
"left_control"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"left_command",
"left_option"
]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.dt\\.Xcode$"
]
}
]
}
]
},
{
"description": "fold code vscode",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "open_bracket",
"modifiers": {
"mandatory": [
"left_control"
]
}
},
"to": [
{
"key_code": "open_bracket",
"modifiers": [
"left_command",
"left_option"
]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.microsoft\\.VSCode$"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "close_bracket",
"modifiers": {
"mandatory": [
"left_control"
]
}
},
"to": [
{
"key_code": "close_bracket",
"modifiers": [
"left_command",
"left_option"
]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.microsoft\\.VSCode$"
]
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment