Skip to content

Commit

Permalink
Karabiner HJKL arrow mode cleanup, scroll with SHIFT, ESC alone
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfallshaw committed May 19, 2019
1 parent 09e4238 commit bf1abb8
Showing 1 changed file with 185 additions and 39 deletions.
224 changes: 185 additions & 39 deletions config/karabiner/karabiner.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,76 +16,88 @@
},
"rules": [
{
"description": "Change CapsLock + h/j/k/l to Arrows",
"description": "CAPS LOCK + hjkl to arrow keys, scroll with SHIFT, ESC alone",
"manipulators": [
{
"description": "VI CapsLock-h to Move Left",
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "h",
"key_code": "j",
"modifiers": {
"mandatory": [
"right_control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"description": "VI CapsLock-j to Move Down",
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"key_code": "k",
"modifiers": {
"mandatory": [
"right_control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"description": "VI CapsLock-k to Move Up",
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"key_code": "h",
"modifiers": {
"mandatory": [
"right_control"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
"key_code": "left_arrow"
}
],
"type": "basic"
},
{
"description": "VI CapsLock-l to Move Right",
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": {
"mandatory": [
"right_control"
],
"optional": [
"any"
]
Expand All @@ -100,11 +112,18 @@
},
{
"description": "VI CapsLock-0 to Beginning of Line",
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "0",
"modifiers": {
"mandatory": [
"right_control"
"optional": [
"any"
]
}
},
Expand All @@ -120,11 +139,18 @@
},
{
"description": "VI CapsLock-4 (as in $) to End of Line",
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "4",
"modifiers": {
"mandatory": [
"right_control"
"optional": [
"any"
]
}
},
Expand All @@ -140,11 +166,18 @@
},
{
"description": "VI CapsLock-b to Back Word",
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "b",
"modifiers": {
"mandatory": [
"right_control"
"optional": [
"any"
]
}
},
Expand All @@ -160,11 +193,18 @@
},
{
"description": "VI CapsLock-w to Forward Word",
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "w",
"modifiers": {
"mandatory": [
"right_control"
"optional": [
"any"
]
}
},
Expand All @@ -177,12 +217,107 @@
}
],
"type": "basic"
}
]
},
{
"description": "Change caps_lock key to right_control. (Post escape key when pressed alone)",
"manipulators": [
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": {
"mandatory": [
"shift"
]
}
},
"to": [
{
"mouse_key": {
"vertical_wheel": 40
}
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": {
"mandatory": [
"shift"
]
}
},
"to": [
{
"mouse_key": {
"vertical_wheel": -40
}
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "h",
"modifiers": {
"mandatory": [
"shift"
]
}
},
"to": [
{
"mouse_key": {
"horizontal_wheel": -30
}
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": {
"mandatory": [
"shift"
]
}
},
"to": [
{
"mouse_key": {
"horizontal_wheel": -30
}
}
],
"type": "basic"
},
{
"from": {
"key_code": "caps_lock",
Expand All @@ -194,7 +329,18 @@
},
"to": [
{
"key_code": "right_control"
"set_variable": {
"name": "caps_lock pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 0
}
}
],
"to_if_alone": [
Expand Down Expand Up @@ -467,4 +613,4 @@
}
}
]
}
}

0 comments on commit bf1abb8

Please sign in to comment.