美文网首页程序员Mac优雅使用指南
为Xcode添加删除整行、复制整行、在下方新建一行快捷键

为Xcode添加删除整行、复制整行、在下方新建一行快捷键

作者: Vissioon | 来源:发表于2018-04-11 16:42 被阅读523次

借鉴文章:高效开发iOS系列 -- 为Xcode添加删除行、复制行快捷键

修改权限

修改Xcode里快捷键的配置文件(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/

打开plist 文件

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

删除整行

然后找到root下的Deletions,在Deletions下添加一个key:Delete Current Line值为:
deleteToBeginningOfLine:, moveToEndOfLine:, deleteToBeginningOfLine:, deleteBackward:

复制整行和在下方添加一行

Insertions and Indentations下添加两个key:

  1. Duplicate Current Line 值为:selectLine:, copy:, moveLeft:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:
  2. Insert Line Under 值为: moveToEndOfLine:, insertNewline:

设置快捷键

重启一下Xcode,然后在preferences里找到Key Bindings,就能找到Delete Current LineDuplicate Current Line两个选项了,最后设置自己喜欢的快捷键即可


plist文件
设置快捷键
设置快捷键

相关文章

网友评论

    本文标题:为Xcode添加删除整行、复制整行、在下方新建一行快捷键

    本文链接:https://www.haomeiwen.com/subject/fjrzhftx.html