Sadly, with MacOS Sierra, Karabiner has gone into a strange kind of hiatus-but-not-really-because-someday-we'll-fix-it.
Which is too bad, because Karabiner was the perfect tool for what I needed (which was make MacOS behave like a forty-year-old UNIX terminal because my stupid fingers still hit ^W to delete a word and I kill the window and I can't stop, no, don't help me, I'll die eventually and then my problem is fixed).
My other main tool is Typinator for abbreviations--w for with, h for the, n for and, etc; those really add up.
So far, I've found BetterTouchTool to be a viable replacement for Karabiner, even better in some ways. But worse in others; key repetition doesn't work for me despite the developer saying it does. (Possibly it interacts with Typinator, but turning the latter off doesn’t fix the problem.)
I've written a whole novel using these two tools (Typinator and BetterTouchTool), but I'd appreciate anyone chiming in if they've found something better still.
You can change the text editing bindings for Cocoa apps with DefaultKeyBinding.dict. This will work for almost all applications where the ⌘ command+← left and ⌘ command+→ right worked before. (The only way it wouldn't work is if the application creator reimplemented those shortcuts from scratch, which is doubtful as it would be much easier to just use the versions that come free with a textfield.)
If the directory ~/Library/KeyBindings/
does not exist, create it.
Create the file DefaultKeyBinding.dict
in that directory with contents like this:
{
"@\Uf702" = moveWordBackward:;
"@\Uf703" = moveWordForward:;
"~\Uf702" = moveToBeginningOfLine:;
"~\Uf703" = moveToEndOfLine:;
}
The @
refers to the Command key, ~
is Option, \Uf702
is Left, and \Uf703
is Right. The selectors on the right-hand side are the same ones used in the default file, /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict
, but switched around to match what you said in your question.
Restart an application for the changes to take effect in it.
Here's an in-depth guide to the Cocoa Text System that should help explain what's going on.
Best Answer
The coding is similar to your question here: Karabiner F1 to Launch Safari? You have to add a vkopenurldef tag though.
Some apps are already defined here:
After an update or an upgrade the file may be overwritten so customize your private.xml and add:
Example:
Then enable it in Change Key. Depending on your settings (Consumer Keys or F1-F12 for the F-keys) in System Preferences -> Keyboard -> Keyboard -> F-key behavior you may have to hit the fn-key also.