I tried putting this in my ~/Library/KeyBindings/DefaultKeyBinding.dict:

"@\U0008"  = "deleteWordBackward:"; /* Cmd  + Backspace */

When I log out and log back in, but it still doesn't work. command+delete (as labeled on my Macbook keyboard) still deletes to the beginning of the line. I also tried

"@\UF728"  = "deleteWordForward:"; /* Cmd  + Delete */

and in that case command+delete still deletes to the beginning of the line. If I'm not mistaken, the "delete" key on my Macbook Pro Retina is what the comment in the example refers to as "Backspace", and there is no actual "Delete" key on the keyboard.

I was able to successfully change command+arrows to move word by word instead of to the beginning and end of the document by doing

"@\UF703"  = "moveWordForward:"; /* Cmd  + RightArrow */
"@\UF702"  = "moveWordBackward:"; /* Cmd  + LeftArrow */

so I know that at least some bindings are working, among others. I just can't get command+delete to delete back a word.

  • @danielAzuelos You mean the default shortcut? Sure, it works, but I want my bindings to be the same in Windows, Linux, and Mac OS X. I personally find command+backspace/delete to be better because I use capslock as control in Windows and Linux, and capslock as control in Mac OS X in certain apps like Terminal, Vim, etc, and capslock as command in normal OS X apps. So my pinky just goes to capslock key for everything. I hardly every need actual capslock so I put that on right alt or something I also rarely use. I don't even have to budge from the home row with capslock. – trusktr Nov 9 '14 at 2:16

This works for me on an iMac:

"@\U007f" = ( deleteWordBackward:);
  • That was it. Thanks. I was using the "Backspace" code from this reference: heisencoder.net/2008/04/… Is that outdated? Or is a normal PC Backspace just different from Mac delete? – trusktr Nov 9 '14 at 2:13
  • Backspace has been 0x08, and Delete 0x07f since the inception of the ASCII code. – dan Nov 11 '14 at 10:38

You must log in to answer this question.

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