Skip to content

Instantly share code, notes, and snippets.

@gdavis
Last active January 16, 2023 16:44
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save gdavis/2829437 to your computer and use it in GitHub Desktop.
Save gdavis/2829437 to your computer and use it in GitHub Desktop.
Xcode 4 Custom Key Commands - Add to IDETextKeyBindingsSet.plist
<key>GDI Commands</key>
<dict>
<key>GDI Duplicate Current Line</key>
<string>selectLine:, copy:, moveToEndOfLine:, insertNewLine:, moveToBeginningOfLine:, paste:, moveUp:, moveToEndOfLine:</string>
<key>GDI Delete Current Line</key>
<string>moveToEndOfLine:, deleteToBeginningOfLine:, deleteBackward:, moveDown:, moveToEndOfLine:</string>
<key>GDI Move Current Line Up</key>
<string>selectLine:, cut:, moveUp:, moveToBeginningOfLine:, insertNewLine:, paste:, moveBackward:</string>
<key>GDI Move Current Line Down</key>
<string>selectLine:, cut:, moveDown:, moveToBeginningOfLine:, insertNewLine:, paste:, moveBackward:</string>
<key>GDI Insert Line Above</key>
<string>moveUp:, moveToEndOfLine:, insertNewline:</string>
<key>GDI Insert Line Below</key>
<string>moveToEndOfLine:, insertNewline:</string>
</dict>
@gdavis
Copy link
Author

gdavis commented May 29, 2012

Find:
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist

Add this dictionary to the PLIST and then go into Xcode -> Preferences -> Key Bindings and add custom key bindings for these commands. Done!

@XueshiQiao
Copy link

Great! I seek for these hot keys for months, it helps me a lot!
Thx very much, @gdavis !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment