Last active
February 28, 2025 14:07
-
-
Save jamietre/6457204045dce85476a693d21142edc3 to your computer and use it in GitHub Desktop.
Karabiner Elements config to map home/end keys to PC-like behavior on MacOS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "MacOS -> PC Shortcuts", | |
"rules": [ | |
{ | |
"description": "Top/bottom of document (ctrl+home/ctrl+end)", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": <%= from("home", ["command"], ["any"]) %>, | |
"to": <%= to([["up_arrow", ["left_command"]]]) %>, | |
"conditions": [ <%= frontmost_application_unless(["remote_desktop", "virtual_machine"]) %> ] | |
}, | |
{ | |
"type": "basic", | |
"from": <%= from("end", ["command"], ["any"]) %>, | |
"to": <%= to([["down_arrow", ["left_command"]]]) %>, | |
"conditions": [ <%= frontmost_application_unless(["remote_desktop", "virtual_machine"]) %> ] | |
} | |
] | |
}, | |
{ | |
"description": "Home/end keys to the beginning/end line", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": <%= from("home", [], ["any"]) %>, | |
"to": <%= to([["a", ["left_control"]]]) %>, | |
"conditions": [ <%= frontmost_application_unless(["remote_desktop", "virtual_machine"]) %> ] | |
}, | |
{ | |
"type": "basic", | |
"from": <%= from("end", [], ["any"]) %>, | |
"to": <%= to([["e", ["right_control"]]]) %>, | |
"conditions": [ <%= frontmost_application_unless(["remote_desktop", "virtual_machine"]) %> ] | |
} | |
] | |
}, | |
{ | |
"description": "Move by word (command+right/command+left)", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": <%= from("right_arrow", ["command"], ["any"]) %>, | |
"to": <%= to([["right_arrow", ["left_option"]]]) %>, | |
"conditions": [ <%= frontmost_application_unless(["remote_desktop", "virtual_machine"]) %> ] | |
}, | |
{ | |
"type": "basic", | |
"from": <%= from("left_arrow", ["command"], ["any"]) %>, | |
"to": <%= to([["left_arrow", ["left_option"]]]) %>, | |
"conditions": [ <%= frontmost_application_unless(["remote_desktop", "virtual_machine"]) %> ] | |
} | |
] | |
}, | |
{ | |
"description": "Swap Control <-> Command unless in virtual machine/remote desktop", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": <%= from("left_control", [], ["any"]) %>, | |
"to": <%= to([["left_command"]]) %>, | |
"conditions": [ <%= frontmost_application_unless(["remote_desktop", "virtual_machine"]) %> ] | |
}, | |
{ | |
"type": "basic", | |
"from": <%= from("left_command", [], ["any"]) %>, | |
"to": <%= to([["left_control"]]) %>, | |
"conditions": [ <%= frontmost_application_unless(["remote_desktop", "virtual_machine"]) %> ] | |
}, | |
{ | |
"type": "basic", | |
"from": <%= from("right_control", [], ["any"]) %>, | |
"to": <%= to([["right_command"]]) %>, | |
"conditions": [ <%= frontmost_application_unless(["remote_desktop", "virtual_machine"]) %> ] | |
}, | |
{ | |
"type": "basic", | |
"from": <%= from("right_command", [], ["any"]) %>, | |
"to": <%= to([["right_control"]]) %>, | |
"conditions": [ <%= frontmost_application_unless(["remote_desktop", "virtual_machine"]) %> ] | |
} | |
] | |
} | |
] | |
} |
can anybody that already ran this post the resulting json please?
As of writing, this doesn't seem to work. Looks like the original repo lost its ability to compile ruby template files...
The workaround I ended up with is to simply use the "PC-Style Shortcuts" that can be imported into Karabiner from its own UI. They have all the shortcuts included in this gist.
use the "PC-Style Shortcuts" that can be imported into Karabiner from its own UI. They have all the shortcuts included in this gist.
thanks, this worked great for me too.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated with the old version there too for historical purposes. I don't use a mac anymore at work so I can't test anything ;)