Skip to content

Instantly share code, notes, and snippets.

@ilyeshammadi
Last active March 14, 2024 10:39
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 ilyeshammadi/a021cfb28465f20fde2dd59cba773e4d to your computer and use it in GitHub Desktop.
Save ilyeshammadi/a021cfb28465f20fde2dd59cba773e4d to your computer and use it in GitHub Desktop.
Karabiner Mappings
{
"title": "Change caps_lock to Esc and Control",
"rules": [
{
"description": "Post Esc if Caps is tapped, Control if held.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_control",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "left_control",
"lazy": true
}
],
"to_if_alone": [
{
"key_code": "escape"
}
]
}
]
}
]
}
{
"title": "left_option + hjkl to Arrow Keys Vim",
"rules": [
{
"description": "left_option + hjkl to arrow keys Vim",
"manipulators": [
{
"from": {
"key_code": "h",
"modifiers": {
"mandatory": [
"left_option"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic",
"to_if_alone": [
{
"key_code": "left_option"
}
]
},
{
"from": {
"key_code": "j",
"modifiers": {
"mandatory": [
"left_option"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic",
"to_if_alone": [
{
"key_code": "left_option"
}
]
},
{
"from": {
"key_code": "k",
"modifiers": {
"mandatory": [
"left_option"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic",
"to_if_alone": [
{
"key_code": "left_option"
}
]
},
{
"from": {
"key_code": "l",
"modifiers": {
"mandatory": [
"left_option"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic",
"to_if_alone": [
{
"key_code": "left_option"
}
]
}
]
}
]
}
{
"title": "Tab or Option if hold",
"rules": [
{
"description": "Tab or Option if hold",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "tab",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "left_option",
"lazy": true
}
],
"to_if_alone": [
{
"key_code": "tab"
}
]
}
]
}
]
}
The previous files are for the complext modifications section in Karabinier.
We also need to set a simple modificiation, which to set `caps_lock` -> `left_control` for this to work.
The order of the complex must of the following, otherwise some mapping will not work as expected:
Order from top to bottom in the Karabinier UI.
1. custom-capslock.json
2. custom-tab.json
3. custom-left_option.json
these files should be placed in `.config/karabiner/assets/complex_modifications/`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment