Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dragon788
Forked from pirj/f_hjkl_movements.json
Created September 16, 2019 18:07
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 dragon788/6bdb9a7ae02e6ed671a74addba54a688 to your computer and use it in GitHub Desktop.
Save dragon788/6bdb9a7ae02e6ed671a74addba54a688 to your computer and use it in GitHub Desktop.
Karabiner complex modiications: Vi'ish mode
{
"title": "F + HJKL",
"rules": [
{
"description": "Vi'ish Mode [F as Trigger Key]",
"manipulators": [
{
"type": "basic",
"parameters": {
"basic.to_delayed_action_delay_milliseconds": 150,
"basic.to_if_held_down_threshold_milliseconds": 150
},
"from": { "key_code": "f", "modifiers": { } },
"to_if_alone": [ { "key_code": "f" } ],
"to_if_held_down": [ { "set_variable": { "name": "vi_mode", "value": 1 }, "halt": true } ],
"to_after_key_up": [ { "set_variable": { "name": "vi_mode", "value": 0 } } ],
"to_delayed_action": { "to_if_canceled": [ { "key_code": "f" }, { "set_variable": { "name": "vi_mode", "value": 0 } } ] }
},
{
"type": "basic",
"from": { "key_code": "j", "modifiers": { "optional": [ "any" ] } },
"to": [ { "key_code": "down_arrow" } ],
"conditions": [ { "type": "variable_if", "name": "vi_mode", "value": 1 } ]
},
{
"type": "basic",
"from": { "key_code": "k", "modifiers": { "optional": [ "any" ] } },
"to": [ { "key_code": "up_arrow" } ],
"conditions": [ { "type": "variable_if", "name": "vi_mode", "value": 1 } ]
},
{
"type": "basic",
"from": { "key_code": "h", "modifiers": { "optional": [ "any" ] } },
"to": [ { "key_code": "left_arrow" } ],
"conditions": [ { "type": "variable_if", "name": "vi_mode", "value": 1 } ]
},
{
"type": "basic",
"from": { "key_code": "l", "modifiers": { "optional": [ "any" ] } },
"to": [ { "key_code": "right_arrow" } ],
"conditions": [ { "type": "variable_if", "name": "vi_mode", "value": 1 } ]
},
{
"type": "basic",
"from": { "key_code": "b", "modifiers": { "optional": [ "any" ] } },
"to": [ { "key_code": "left_arrow", "modifiers": [ "left_option" ] } ],
"conditions": [ { "type": "variable_if", "name": "vi_mode", "value": 1 } ]
},
{
"type": "basic",
"from": { "key_code": "w", "modifiers": { "optional": [ "any" ] } },
"to": [ { "key_code": "right_arrow", "modifiers": [ "left_option" ] } ],
"conditions": [ { "type": "variable_if", "name": "vi_mode", "value": 1 } ]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment