3

I've switched my Ctrl and Cmd key to replicate my hotkeys on Windows. I've fixed my home and end keys to behave as I'd like and now all that's left is remapping my Cmd+ and Cmd+ to behave properly.

So far - tried a bunch of things suggested on StackOverflow and really can't get it to work. I've tried:

  • Possible to move the cursor word-by-word with Cmd+left/right instead of Alt+left/right? (accepted answer and KeyBindingsEditor program).
  • The following in my ~/Library/KeyBindings/DefaultKeyBinding.dict (from http://heisencoder.net/2008/04/fixing-up-mac-key-bindings-for-windows.html):

    {
    "\UF729"   = "moveToBeginningOfLine:";                       /* Home         */
    "@\UF729"  = "moveToBeginningOfDocument:";                   /* Cmd  + Home  */
    "$\UF729"  = "moveToBeginningOfLineAndModifySelection:";     /* Shift + Home */
    "@$\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; /* Shift + Cmd  + Home */
    "\UF72B"   = "moveToEndOfLine:";                             /* End          */
    "@\UF72B"  = "moveToEndOfDocument:";                         /* Cmd  + End   */
    "$\UF72B"  = "moveToEndOfLineAndModifySelection:";           /* Shift + End  */
    "@$\UF72B" = "moveToEndOfDocumentAndModifySelection:";       /* Shift + Cmd  + End */
    "\UF72C"   = "pageUp:";                                      /* PageUp       */
    "\UF72D"   = "pageDown:";                                    /* PageDown     */
    "$\UF728"  = "cut:";                                         /* Shift + Del  */
    "$\UF727"  = "paste:";                                       /* Shift + Ins */
    "@\UF727"  = "copy:";                                        /* Cmd  + Ins  */
    "$\UF746"  = "paste:";                                       /* Shift + Help */
    "@\UF746"  = "copy:";                                        /* Cmd  + Help (Ins) */
    "@\UF702"  = "moveWordBackward:";                            /* Cmd  + LeftArrow */
    "@\UF703"  = "moveWordForward:";                             /* Cmd  + RightArrow */
    "@$\UF702" = "moveWordBackwardAndModifySelection:";   /* Shift + Cmd  + Leftarrow */
    "@$\UF703" = "moveWordForwardAndModifySelection:";   /* Shift + Cmd  + Rightarrow */
    }
    

Any ideas why this won't work for me?

9
  • So, do you want a fix, or do you want to know why your described method is not working? Commented May 25, 2015 at 15:41
  • @CousinCocaine A fix would be preferred. Commented May 26, 2015 at 19:19
  • 1
    Looked at Karabiner? pqrs.org/osx/karabiner/index.html.en Commented May 27, 2015 at 9:19
  • Both options work for me. I even did a straight copy from your posted code. Remember for the effects to take place you must logout and back in.
    – markhunte
    Commented May 31, 2015 at 9:39
  • @markhunte That is interesting. Can I double-check? To test it, did you switched the CTRL and CMD key as described and saved the dict to ~/Library/KeyBindings/DefaultKeyBinding.dict , logged out and back in and now you can jump words with CMD-arrow?
    – user128544
    Commented May 31, 2015 at 9:52

1 Answer 1

2
+100

I know that you are trying to do this via KeyBindings, but here is an alternative method using Keyboard Maestro:

Keyboard Maestro to remap keys

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .