Xcode Version 6.1
在终端运行
sudo chmod 666 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist
然后打开 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist
在Deletions下添加 (注意逗号后面还有空格)
<key>Delete Current Line</key>
<string>moveToEndOfLine:, deleteToBeginningOfLine:, moveDown:, moveToBeginningOfLine:, deleteBackward:</string>
<key>Duplicate Current Line</key>
<string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
然后重启Xcode,打开Preferences 偏好设置,Key Bindings,找到“Delete Current Line”和”Duplicate Current Line”这两项,设置为自己想要的快捷键。