Skip to content

Instantly share code, notes, and snippets.

@parMaster
Last active May 20, 2024 13:56
Show Gist options
  • Save parMaster/ab391983151314a6532c99248ff7c75a to your computer and use it in GitHub Desktop.
Save parMaster/ab391983151314a6532c99248ff7c75a to your computer and use it in GitHub Desktop.
Karabiner configuration. Right Command = Hyper key. Hyper + {I, J, K, L} = {↑, ←, ↓, →}; ----- Hyper + {U, O} = {Home, End}; ----- Hyper + {;, p} = {Enter, Backspace}; ----- Hyper + {Y, H} = {PgUp, PgDown}; Quit app by command-q twice; Quit app by holding command-q; ----- Hyper + {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =} = {F1-F12}
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"description": "Change caps_lock to control+shift if pressed alone and to left control if pressed with other keys.",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_control"
}
],
"to_if_alone": [
{
"key_code": "spacebar",
"modifiers": [
"left_control"
]
}
],
"type": "basic"
}
]
},
{
"description": "Right Command = Hyper",
"manipulators": [
{
"from": {
"key_code": "right_command",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "hyper_mod",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "hyper_mod",
"value": 0
}
}
],
"type": "basic"
}
]
},
{
"description": "Hyper + {I, J, K, L} = {↑, ←, ↓, →}",
"manipulators": [
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "i",
"modifiers": {
"optional": [
"shift",
"left_command",
"left_option"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": {
"optional": [
"shift",
"left_command",
"left_option"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": {
"optional": [
"shift",
"left_command",
"left_option"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": {
"optional": [
"shift",
"left_command",
"left_option"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic"
}
]
},
{
"description": "Hyper + {U, O} = {Home, End}",
"manipulators": [
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "u",
"modifiers": {
"optional": [
"shift",
"left_command"
]
}
},
"to": [
{
"key_code": "home"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "o",
"modifiers": {
"optional": [
"shift",
"left_command"
]
}
},
"to": [
{
"key_code": "end"
}
],
"type": "basic"
}
]
},
{
"description": "Hyper + {;, p} = {Enter, Backspace}",
"manipulators": [
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "semicolon",
"modifiers": {
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "return_or_enter"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "p",
"modifiers": {}
},
"to": [
{
"key_code": "delete_or_backspace"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "p",
"modifiers": {
"mandatory": [
"shift"
]
}
},
"to": [
{
"key_code": "delete_forward"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "p",
"modifiers": {
"mandatory": [
"option"
]
}
},
"to": [
{
"key_code": "delete_or_backspace",
"modifiers": "option"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "p",
"modifiers": {
"mandatory": [
"command"
]
}
},
"to": [
{
"key_code": "delete_or_backspace",
"modifiers": "command"
}
],
"type": "basic"
}
]
},
{
"description": "Hyper + {Y, H} = {PgUp, PgDown}",
"manipulators": [
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "y",
"modifiers": {
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "page_up"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "h",
"modifiers": {
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "page_down"
}
],
"type": "basic"
}
]
},
{
"description": "Hyper + {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =} = {F1-F12}",
"manipulators": [
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "1",
"modifiers": {
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "f1"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "2",
"modifiers": {
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "f2"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "3",
"modifiers": {
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "f3"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "4",
"modifiers": {
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "f4"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "5",
"modifiers": {
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "f5"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "6",
"modifiers": {
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "f6"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "7",
"modifiers": {
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "f7"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "8",
"modifiers": {
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "f8"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "9",
"modifiers": {
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "f9"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "0",
"modifiers": {
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "f10"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "hyphen",
"modifiers": {
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "f11"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "hyper_mod",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "equal_sign",
"modifiers": {
"optional": [
"shift"
]
}
},
"to": [
{
"key_code": "f12"
}
],
"type": "basic"
}
]
},
{
"description": "Shift + ⌫ = ⌦",
"manipulators": [
{
"from": {
"key_code": "delete_or_backspace",
"modifiers": {
"mandatory": [
"shift"
]
}
},
"to": [
{
"key_code": "delete_forward"
}
],
"type": "basic"
}
]
},
{
"description": "Quit application by pressing command-q twice",
"manipulators": [
{
"conditions": [
{
"name": "command-q",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "q",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "q",
"modifiers": "left_command"
}
],
"type": "basic"
},
{
"from": {
"key_code": "q",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"set_variable": {
"name": "command-q",
"value": 1
}
}
],
"to_delayed_action": {
"to_if_canceled": [
{
"set_variable": {
"name": "command-q",
"value": 0
}
}
],
"to_if_invoked": [
{
"set_variable": {
"name": "command-q",
"value": 0
}
}
]
},
"type": "basic"
}
]
},
{
"description": "Quit application by holding command-q",
"manipulators": [
{
"from": {
"key_code": "q",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to_if_held_down": [
{
"key_code": "q",
"modifiers": [
"left_command"
],
"repeat": false
}
],
"type": "basic"
}
]
},
{
"description": "Quit Safari by pressing command-q twice",
"manipulators": [
{
"conditions": [
{
"name": "command-q",
"type": "variable_if",
"value": 1
},
{
"bundle_identifiers": [
"^com\\.apple\\.Safari$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "q",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "q",
"modifiers": "left_command"
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Safari$"
],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "q",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"set_variable": {
"name": "command-q",
"value": 1
}
}
],
"to_delayed_action": {
"to_if_canceled": [
{
"set_variable": {
"name": "command-q",
"value": 0
}
}
],
"to_if_invoked": [
{
"set_variable": {
"name": "command-q",
"value": 0
}
}
]
},
"type": "basic"
}
]
}
]
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"game_pad_swap_sticks": false,
"identifiers": {
"is_game_pad": false,
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 627,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"mouse_flip_horizontal_wheel": false,
"mouse_flip_vertical_wheel": false,
"mouse_flip_x": false,
"mouse_flip_y": false,
"mouse_swap_wheels": false,
"mouse_swap_xy": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"game_pad_swap_sticks": false,
"identifiers": {
"is_game_pad": false,
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 591,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"mouse_flip_horizontal_wheel": false,
"mouse_flip_vertical_wheel": false,
"mouse_flip_x": false,
"mouse_flip_y": false,
"mouse_swap_wheels": false,
"mouse_swap_xy": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"game_pad_swap_sticks": false,
"identifiers": {
"is_game_pad": false,
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 50479,
"vendor_id": 1133
},
"ignore": false,
"manipulate_caps_lock_led": false,
"mouse_flip_horizontal_wheel": false,
"mouse_flip_vertical_wheel": false,
"mouse_flip_x": false,
"mouse_flip_y": false,
"mouse_swap_wheels": false,
"mouse_swap_xy": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"game_pad_swap_sticks": false,
"identifiers": {
"is_game_pad": false,
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 627,
"vendor_id": 1452
},
"ignore": true,
"manipulate_caps_lock_led": false,
"mouse_flip_horizontal_wheel": false,
"mouse_flip_vertical_wheel": false,
"mouse_flip_x": false,
"mouse_flip_y": false,
"mouse_swap_wheels": false,
"mouse_swap_xy": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"game_pad_swap_sticks": false,
"identifiers": {
"is_game_pad": false,
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 33424,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"mouse_flip_horizontal_wheel": false,
"mouse_flip_vertical_wheel": false,
"mouse_flip_x": false,
"mouse_flip_y": false,
"mouse_swap_wheels": false,
"mouse_swap_xy": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"game_pad_swap_sticks": false,
"identifiers": {
"is_game_pad": false,
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 33424,
"vendor_id": 1452
},
"ignore": true,
"manipulate_caps_lock_led": false,
"mouse_flip_horizontal_wheel": false,
"mouse_flip_vertical_wheel": false,
"mouse_flip_x": false,
"mouse_flip_y": false,
"mouse_swap_wheels": false,
"mouse_swap_xy": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": [
{
"key_code": "vk_consumer_brightness_down"
}
]
},
{
"from": {
"key_code": "f2"
},
"to": [
{
"key_code": "vk_consumer_brightness_up"
}
]
},
{
"from": {
"key_code": "f3"
},
"to": [
{
"key_code": "vk_mission_control"
}
]
},
{
"from": {
"key_code": "f4"
},
"to": [
{
"key_code": "vk_launchpad"
}
]
},
{
"from": {
"key_code": "f5"
},
"to": [
{
"key_code": "vk_consumer_illumination_down"
}
]
},
{
"from": {
"key_code": "f6"
},
"to": [
{
"key_code": "vk_consumer_illumination_up"
}
]
},
{
"from": {
"key_code": "f7"
},
"to": [
{
"key_code": "vk_consumer_previous"
}
]
},
{
"from": {
"key_code": "f8"
},
"to": [
{
"key_code": "vk_consumer_play"
}
]
},
{
"from": {
"key_code": "f9"
},
"to": [
{
"key_code": "vk_consumer_next"
}
]
},
{
"from": {
"key_code": "f10"
},
"to": [
{
"key_code": "mute"
}
]
},
{
"from": {
"key_code": "f11"
},
"to": [
{
"key_code": "volume_down"
}
]
},
{
"from": {
"key_code": "f12"
},
"to": [
{
"key_code": "volume_up"
}
]
}
],
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [],
"virtual_hid_keyboard": {
"caps_lock_delay_milliseconds": 0,
"country_code": 0,
"indicate_sticky_modifier_keys_state": true,
"keyboard_type": "ansi",
"mouse_key_xy_scale": 100
}
}
]
}
@parMaster
Copy link
Author

Added:

  • Command + p -> Command + Backspace
  • Option + p -> Option + Backspace
  • Shift + p -> Shift + Backspace (delete)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment