HINT: these don't mess with the clipboard or the undo history
-
Copy the following snippet into
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist
<key>Custom</key> <dict> <key>Duplicate Current Line Down</key> <string>selectParagraph:, delete:, undo:, moveRight:, yank:, moveLeft:</string> <key>Duplicate Current Line Up</key> <string>selectParagraph:, delete:, undo:, moveLeft:, yank:, moveLeft:</string> </dict>
-
Assign shortcuts in Xcode -> Preferences -> Key Bindings
Duplicate Current Line Down –>
shift
+alt
+↓
Duplicate Current Line Up –>
shift
+alt
+↑