Mac – 为 Xcode 添加常用快捷键
     发布在:System      浏览:54      评论:0 条评论

在使用 sublime 过程中,特喜欢删除一行、复制一行等快捷键

然而在 Xcode 中却并未提供

修改权限

> 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/Resources/IDETextKeyBindingSet.plist

删除一行

栏目:Deletions

key:Delete Current Line

value:deleteToBeginningOfLine:, moveToEndOfLine:, deleteToBeginningOfLine:, deleteBackward:, moveDown:, moveToBeginningOfLine:

重复当前行

栏目:Insertions and Indentations

key:Duplicate Current Line

value:selectLine:, copy:, moveToBeginningOfLine:, paste:, moveToEndOfLine:

向上新增一行

栏目:Insertions and Indentations

key:Insert New Line Begin

value:moveToBeginningOfLine:, insertNewline:, moveUp:

向下新增一行

栏目:Insertions and Indentations

key:Insert New Line Under

value:moveToEndOfLine:, insertNewline:

复制当前行

栏目:Insertions and Indentations

key:Copy Current Line

value:selectLine:, copy:, moveToLeftEndOfLine:, moveToRightEndOfLine:

剪切当前行

栏目:Insertions and Indentations

key:Cut Current Line

value:selectLine:, copy:, deleteToBeginningOfLine:, moveToEndOfLine:, deleteToBeginningOfLine:

粘贴当前行(配合剪切当前行使用)

栏目:Insertions and Indentations

key:Paste Current Line

value:moveToBeginningOfLine:, paste:, moveToEndOfLine:

配置快捷键

1、重启 Xcode

2、command + , 打开 Preferences,找到 Key Bindings

3、利用关键字搜索找到上面设置的快捷方式的 value

4、最后设置自己喜欢的快捷键即可

Mac - 为 Xcode 添加常用快捷键
Mac - 为 Xcode 添加常用快捷键
Responses