open /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist
删除一行
然后找到root下的Deletions,在Deletions下添加一个key:Delete Current Line 值为:deleteToBeginningOfLine:, moveToEndOfLine:, deleteToBeginningOfLine:, deleteBackward:, moveDown:, moveToBeginningOfLine:
复制一行
在Insertions and Indentations下添加两个key:
Duplicate Current Line 值为:selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:
Insert Line Under 值为: moveToEndOfLine:, insertNewline:
设置快捷键
重点来了, 重启一下Xcode,然后在preferences里找到Key Bindings,就能找到Delete Current Line和Duplicate Current Line两个选项了,最后设置自己喜欢的快捷键即可