Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


The ~/Library/KeyBindings/DefaultKeyBinding.dict file lets you define your own key bindings in Mac OS X. It can be in one of two formats: old-style NeXT format (example) or modern-style XML plist format (example).

Rebinding +

I wanted to rebind command-backspace (+) to deleteWordBackward:, and I got some help over in this AskDifferent thread. It was suggested that I use this as my DefaultKeyBinding.dict file:

/* my keybindings */
"@\U007F" = "deleteWordBackward:"; /* delete backwards one word */

This advice worked (thanks, guys!), but I already have a working DefaultKeybinding.dict in the XML format, so I wanted to try to get it working that way. I first added just this text near the bottom of my existing file:


And I also tried creating a brand-new XML-formatted file with just the + entry:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">

But neither files worked. The apparent situation, then, is that you can rebind + only in the old-style NeXT format, and not in the XML plist format. My questions are:

  1. Is this accurate, or should the syntax change somehow when I'm switching to XML format?
  2. Will I regret moving the rest of my DefaultKeyBinding.dict file over to the old syntax? It wouldn't be much work to do so - it's only one or two dozen entries - but I'm not sure if the old style is deprecated or ill-advised for some other reason.

Edit: Original DefaultKeyBinding.dict

Someone requested information on my original file in the comments, so I figure I might as well include the whole thing here.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
    <key>^ </key>
share|improve this question
+1 good question – conorgriffin Sep 14 '11 at 21:50
I haven't used the XML format, but I'm curious as to whether you are using any other meta-keys in your keyboard shortcuts in the existing XML file you have. Are you using ~ for option or $ for shift? – conorgriffin Sep 14 '11 at 22:35
or ^ for control? – conorgriffin Sep 14 '11 at 22:50
I have working entries with ~ and ^, but none with $ or @. (Note: I went ahead and added my original DefaultKeyBindings.dict file to the OP as well in case that turns out to be useful.) – Micah R Ledbetter Sep 14 '11 at 23:13
It's odd, I can't get it to work either. It doesn't seem to be very well documented. You only have a small number of shortcuts which are not simply 1 meta-key and 1 letter so maybe try converting those to test and if they work then it's likely your other ones will too. It may be the case that representing the command key as @ is not accepted in the XML style of plist file. It doesn't make much sense but I can't find anything more about it. – conorgriffin Sep 14 '11 at 23:31

I don't think you'll have any issues using the older format. All the examples I've found use the old NeXT notation. Although I can't explain why the XML format didn't work, there is a workaround for this particular keyboard shortcut which would mean you can leave your existing DefaultKeyBinding.dict untouched.

There is an application called KeyRemap4MacBook which is free to download and you can see from the screenshot below, you could remap the + keyboard shortcut without converting the rest of your DefaultKeyBinding.dict file and this method is not limited to Cocoa applications.


share|improve this answer

\U007f can't be used on XML property lists. You'd need to replace it with &#x007f; or a literal DEL character.

You can convert an old-style plist to XML with plutil:

plutil -convert xml1 test.plist

And from XML to old-style with pl:

pl -input test.plist

My DefaultKeyBinding.dict is currently 151 lines, and I haven't run into any issues storing it as an old-style property list. The ones posted by Brett Terpstra and Jacob Rus are in the old-style format as well.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.