I find this shortcut extremely useful in Xcode: duplicate one or several lines without losing what you have on the clipboard.
UPDATE: it seems Xcode finally added this feature as of version 14: one can now select text and use the usual duplicate shortcut (Cmd-D)
- To add custom key bindings in Xcode, you have to edit this file (su privileges required):
'/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/Current/Resources/IDETextKeyBindingSet.plist