Search code examples
xcodekeyboard-shortcutskey-bindingsxcode5

Key bindings in Xcode 5


I used to do this: Xcode duplicate line

But IDETextKeyBindingSet.plist doesn't exist anymore.

There is a folder called "KeyBindings" with a blank text file in it.

So how do we set up key bindings now?

Specifically I just want command-D to duplicate the line the cursor is in, which is a basic functionality of every other IDE except Xcode.


Solution

  • The KeyBindings directory stores just per-user key bindings for already available operations in Xcode. On the other hand, the IDETextKeyBindingSet.plist lets you add an operation to Xcode itself (and afterwards put a key binding into your KeyBindings dir).

    Just put the IDETextKeyBindingSet.plist file again into /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources (the location is the same as in Xcode 4). And make yourself a backup, since each Xcode upgrade will default your customized bindings (if there's a better solution for Xcode upgrades, I'm all ears).