Skip to content

Instantly share code, notes, and snippets.

@piskov
Created January 20, 2023 17:27
Show Gist options
  • Save piskov/5e7f7905ad5c28f1c5952ddfb23b1851 to your computer and use it in GitHub Desktop.
Save piskov/5e7f7905ad5c28f1c5952ddfb23b1851 to your computer and use it in GitHub Desktop.
{
"title": "Use CAPS LOCK for vi navigation",
"rules": [
{
"description": "CAPS LOCK custom layer",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "j",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "k",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "q",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"left_command",
"left_shift"
],
"key_code": "4"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "e",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"left_command",
"left_option"
],
"key_code": "spacebar"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "spacebar",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "delete_forward"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "h",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "l",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "y",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"left_command"
],
"key_code": "left_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "o",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"left_command"
],
"key_code": "right_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "u",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"left_command"
],
"key_code": "down_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "i",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"left_command"
],
"key_code": "up_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "semicolon",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"left_option"
],
"key_code": "left_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "quote",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"left_option"
],
"key_code": "right_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "w",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"left_command",
"left_control"
],
"key_code": "f"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "s",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"left_command"
],
"key_code": "m"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"modifiers": {
"optional": [
"any"
]
},
"key_code": "escape"
},
"to": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"repeat": true,
"key_code": "escape"
}
]
},
{
"type": "basic",
"from": {
"key_code": "n",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"left_option",
"left_control",
"left_shift"
],
"key_code": "left_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "m",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"left_option",
"left_control",
"left_shift"
],
"key_code": "down_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "comma",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"left_option",
"left_control",
"left_shift"
],
"key_code": "up_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "period",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"left_option",
"left_control",
"left_shift"
],
"key_code": "right_arrow"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
},
{
"type": "basic",
"from": {
"key_code": "a",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"right_option",
"right_command"
],
"key_code": "f1"
}
],
"conditions": [
{
"type": "variable_if",
"name": "caps_lock pressed",
"value": 1
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment