Xcode 复制多行/移动某行/删除多行 快捷键

https://developer.aliyun.com/article/49215

简介:

首先,用XCode打开

 

/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist

增加

 

<key>My Custom Keys</key>
<dict>
    <key>Move Line Up</key>
    <string>selectLine:, cut:, moveUp:, moveToBeginningOfLine:, paste:, moveUp:</string>
    <key>Move Line Down</key>
    <string>selectLine:, cut:, moveDown:, moveToBeginningOfLine:, paste:, moveUp:</string>
    <key>Duplicate Line</key>
    <string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string>
    <key>Delete Line</key>
    <string>selectLine:, delete:</string>
</dict>
进入xcode,Command+, 打开快捷键设置,搜索刚刚设置的key名称,输入你想设置的快捷键即可。
 
 
 
  1. plist文件权限
sudo chmod 666 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist

sudo chmod 777 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/

open /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist
  1. Insertions and Indentations添加键值
Duplicate Current Line selectLine:, copy:, moveToEndOfLine:, moveToBeginningOfLine:, paste:, moveBackward:
Insert Line Below moveToEndOfLine:, insertNewline:
  1. 重启Xcode,设置快捷键

 
image.png


作者:喵喵粉
链接:https://www.jianshu.com/p/fb5d0ed911aa
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
posted @ 2021-01-01 10:00  sundaysios  阅读(348)  评论(0编辑  收藏  举报