Based on: https://gist.github.com/emotality/b1bcb2bb8a07921f9c8cad1c969daedf
This key binding copies the current line that the marker sits on, and moves the marker to the end of the line.
- Open below directory in Finder with Cmnd + Shift + G
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/
-
Open
IDETextKeyBindingSet.plist
with a text editor. You might have to copy the file to a different location since it might be locked. Remember to save an copy of the original file. -
Add this in:
<key>Copy Line</key>
<dict>
<key>Copy Current Line</key>
<string>moveToEndOfLine:, moveToBeginningOfTextAndModifySelection:, copy:, yank:, paste:</string>
</dict>
-
Open Xcode and go to
Xcode preferences
->Key Bindings
->Text tab
-> Scroll until you seeCopy Line
-
Click on
Copy Current Line
, add a shortcut for it, eg.Shift + Cmd + C
(remove or move any other bindings for this key, or choose another one altogether)
You probably need to restart Xcode in order for the new binding to show up inside preferences.