OS X Keyboard Bindings Windows / Linux-Style

2014-08-05 | #helper, #osx

Ah Mac OS X, you strange creature. If you are used to program in Windows or Linux getting used to your strange keyboard bindings is a real pain in the buttocks, so why do it at all if you don't have to? Just edit the damn bindings to behave like they should!

Open or create

~/Library/KeyBindings/DefaultKeyBinding.dict

and insert the following magic lines

{

“\UF729″ = “moveToBeginningOfLine:”; /* pos1 */

“^\UF729″ = “moveToBeginningOfDocument:”; /* crtl + pos1 */

“$\UF729″ = “moveToBeginningOfLineAndModifySelection:”;

“\UF72b” = “moveToEndOfLine:”; /* end */

“^\UF72B” = “moveToEndOfDocument:”; /* ctrl + end */

“$\UF72B” = “moveToEndOfLineAndModifySelection:”;

“\UF72C” = “pageUp:”;

“\UF72D” = “pageDown:”;

“^~7″ = (”insertText:”, “|”); /* orig alt 7 */

“^~8″ = (”insertText:”, “{”); /* orig alt 8 */

“^~9″ = (”insertText:”, “}”); /* orig alt 9 */

“^\U00DF” = (”insertText:”, “\U00BF”);

“^+” = (”insertText:”, “\U00B1″);

“~<” = (”insertText:”, “|”);

“~7″ = (”insertText:”, “{”);

“~0″ = (”insertText:”, “}”);

“~8″ = (”insertText:”, “[");

"~9" = ("insertText:", "]“);

“~+” = (”insertText:”, “~”);

“~\U00DF” = (”insertText:”, “\U005C”);

“~q” = (”insertText:”, “@”);

“^x” = “cut:”;

“^c” = “copy:”;

“^v” = “paste:”;

}

I'm quite sure that you are able to see what's happening here.

To activate these settings, log out and in again or restart the OS.

Update:

It seems that Apple has removed this possibility with 10.7 or 10.8. Instead you can use Karabiner (see link) to adapt you keybindings, but that's just half as cool in almost all regards. -.-