Based on Stackoverflow solution
- Xcode 9.4.1
- MacOS 10.13.6 High Sierra
$ sudo vim /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist
<key>Custom Commands</key>
<dict>
<key>Cut Current Line</key>
<string>selectLine:, cut:</string>
<key>Copy Current Line</key>
<string>selectLine:, copy:</string>
<key>Duplicate Current Line</key>
<string>selectLine:, copy:, moveToBeginningOfLine:, paste:, moveToEndOfLine:</string>
</dict>
Xcode >> Preferences >> Key Bindings
- Filter by
current line
- Assign shortcuts. For example:
- copy
Command + Control + L
- cut
Command + Control + X
- duplicate
Command + Control + K
- copy