Application

How to add Duplicate Line key binding for Xcode 6 (an IDE for Mac OS X)

Just a quick tip!

Steps:

  1. Go to Applications/
  2. Right Click on Xcode -> Show Package Contents
  3. Go to Contents -> Frameworks -> Resources (shortcut)
  4. Open the location in terminal
  5. chmod 777 the Resources folder and the file IDETextKeyBindingSet.plist during this process
  6. Open the file in Xcode, Something like this will show up:
    Screen Shot 2014-12-09 at 10.13.13 pm
  7. Click on root, add a new Row Customized of type Dictionary
  8. Under that add a new Row for your task with type String with value
    selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:
  9. It should now look like this:
    Screen Shot 2014-12-09 at 10.16.11 pm
  10. Save the file, Close Xcode.
  11. Open Xcode, Go to Preferences > Key Bindings
  12. Scroll all the way down and you will find your new action! Add whatever key binding you like. In my case it was like this:
    Screen Shot 2014-12-09 at 10.20.08 pm
    Notice how I had to change the existing Duplicate command (possibly for some use in Interface Builder)
  13. That’s it! You will have your new key key binding working.
Advertisements