1、修改權(quán)限,終端輸入命令
sudo chmod 666 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist
sudo chmod 777 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/
2全肮、打開plist文件,終端輸入命令
open /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist
3棘捣、整行刪除
找到 root 下的 Deletions
在 Deletions 下添加key: Delete Current Line
value:deleteToBeginningOfLine:, moveToEndOfLine:, deleteToBeginningOfLine:, deleteBackward:
4辜腺、整行復(fù)制并在其下面插入復(fù)制后的內(nèi)容
找到 root 下的 Insertions and Indentations
在 Insertions and Indentations 下添加key:Duplicate Current Line
value:selectLine:, copy:, moveLeft:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:
在 Insertions and Indentations 下添加key:Insert Line Under
value:moveToEndOfLine:, insertNewline:
5、重啟Xcode乍恐,設(shè)置快捷鍵
重啟 Xcode 评疗,在 Preferences 里找到 Key Bindings
找到Delete Current Line
和Duplicate Current Line
設(shè)置對(duì)應(yīng)的快捷鍵