Since Xcode has to be one of the worst IDE's out there, it comes as no surprise even setting custom key bindings requires some extra work.
- Open up
/Applications/Xcode-Beta.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plistin a text editor - Paste this to the end of the file (or any other custom commands you want)
<key>Custom</key>
<dict>
<key>Cut Current Line</key>
<string>selectLine:, copy:, deleteBackward:</string>
<key>Insert and Move to New Line Below</key>
<string>moveToEndOfLine:, insertNewline:</string>
<key>Duplicate Current Line</key>
<string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string>
</dict>
- Restart Xcode
- Inside Xcode go to
Preferences->Key Bindingsand search forCut Current Line(or any other key you added previously) - Add the desired shortcut (
Ctrl Xin my case)