Skip to content

Instantly share code, notes, and snippets.

@justinmklam
Last active December 7, 2025 17:00
Show Gist options
  • Select an option

  • Save justinmklam/3e389a6e06820ffaec1c2dea8381357b to your computer and use it in GitHub Desktop.

Select an option

Save justinmklam/3e389a6e06820ffaec1c2dea8381357b to your computer and use it in GitHub Desktop.
Karabiner configs for macOS

Instructions:

  1. In GUI, add rule under complex modifications
  2. Change to_if_alone_timeout_milliseconds from 1000 to 500 ms

See blog post or KeymapDB for more details.

{
"description": "Layer: Caps Lock Arrows",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"set_variable": {
"name": "option_arrows_mode",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "option_arrows_mode",
"value": 0
}
}
],
"to_if_alone": [],
"type": "basic"
},
{
"conditions": [
{
"name": "option_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "spacebar",
"modifiers": { "optional": ["any"] }
},
"to": [{ "key_code": "delete_or_backspace" }],
"type": "basic"
},
{
"conditions": [
{
"name": "option_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "semicolon",
"modifiers": { "optional": ["any"] }
},
"to": [{ "key_code": "return_or_enter" }],
"type": "basic"
},
{
"conditions": [
{
"name": "option_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "h",
"modifiers": { "optional": ["any"] }
},
"to": [{ "key_code": "left_arrow" }],
"type": "basic"
},
{
"conditions": [
{
"name": "option_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": { "optional": ["any"] }
},
"to": [{ "key_code": "down_arrow" }],
"type": "basic"
},
{
"conditions": [
{
"name": "option_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": { "optional": ["any"] }
},
"to": [{ "key_code": "up_arrow" }],
"type": "basic"
},
{
"conditions": [
{
"name": "option_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": { "optional": ["any"] }
},
"to": [{ "key_code": "right_arrow" }],
"type": "basic"
},
{
"conditions": [
{
"name": "option_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "a",
"modifiers": { "optional": ["any"] }
},
"to": [{ "key_code": "left_control" }],
"type": "basic"
},
{
"conditions": [
{
"name": "option_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "s",
"modifiers": { "optional": ["any"] }
},
"to": [{ "key_code": "left_shift" }],
"type": "basic"
},
{
"conditions": [
{
"name": "option_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "d",
"modifiers": { "optional": ["any"] }
},
"to": [{ "key_code": "left_option" }],
"type": "basic"
},
{
"conditions": [
{
"name": "option_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "f",
"modifiers": { "optional": ["any"] }
},
"to": [{ "key_code": "left_command" }],
"type": "basic"
},
{
"conditions": [
{
"name": "option_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "i",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"key_code": "left_arrow",
"modifiers": ["left_command"]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "option_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "o",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"key_code": "right_arrow",
"modifiers": ["left_command"]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "option_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "u",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"key_code": "tab",
"modifiers": ["left_control", "left_shift"]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "option_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "p",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"key_code": "tab",
"modifiers": ["left_control"]
}
],
"type": "basic"
}
]
}
{
"description": "Layer: Right Command Nav",
"enabled": false,
"manipulators": [
{
"from": {
"key_code": "right_command",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"set_variable": {
"name": "right_command_layer_mode",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "right_command_layer_mode",
"value": 0
}
}
],
"to_if_alone": [{ "key_code": "delete_or_backspace" }],
"type": "basic"
},
{
"conditions": [
{
"name": "right_command_layer_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "o",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"key_code": "c",
"modifiers": ["left_command"]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "right_command_layer_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "p",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"key_code": "v",
"modifiers": ["left_command"]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "right_command_layer_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "i",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"key_code": "x",
"modifiers": ["left_command"]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "right_command_layer_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "u",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"key_code": "a",
"modifiers": ["left_command"]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "right_command_layer_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": { "optional": ["any"] }
},
"to": [{ "mouse_key": { "y": -2536 } }],
"type": "basic"
},
{
"conditions": [
{
"name": "right_command_layer_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": { "optional": ["any"] }
},
"to": [{ "mouse_key": { "y": 2536 } }],
"type": "basic"
},
{
"conditions": [
{
"name": "right_command_layer_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "h",
"modifiers": { "optional": ["any"] }
},
"to": [{ "mouse_key": { "x": -2536 } }],
"type": "basic"
},
{
"conditions": [
{
"name": "right_command_layer_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": { "optional": ["any"] }
},
"to": [{ "mouse_key": { "x": 2536 } }],
"type": "basic"
},
{
"conditions": [
{
"name": "right_command_layer_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "v",
"modifiers": { "optional": ["any"] }
},
"to": [{ "pointing_button": "button1" }],
"type": "basic"
},
{
"conditions": [
{
"name": "right_command_layer_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "c",
"modifiers": { "optional": ["any"] }
},
"to": [{ "pointing_button": "button2" }],
"type": "basic"
},
{
"conditions": [
{
"name": "right_command_layer_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "f",
"modifiers": { "optional": ["any"] }
},
"to": [{ "mouse_key": { "vertical_wheel": 128 } }],
"type": "basic"
},
{
"conditions": [
{
"name": "right_command_layer_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "d",
"modifiers": { "optional": ["any"] }
},
"to": [{ "mouse_key": { "vertical_wheel": -128 } }],
"type": "basic"
}
]
}
{
"description": "Post Tab if Tab is tapped, Control if held.",
"manipulators": [
{
"from": {
"key_code": "tab",
"modifiers": { "optional": ["any"] }
},
"to": [
{
"key_code": "left_control",
"lazy": true
}
],
"to_if_alone": [{ "key_code": "tab" }],
"type": "basic"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment