macOS 为 Xcode 添加常用快捷键
in Others with 4 comments, Views is 228

macOS 为 Xcode 添加常用快捷键

in Others with 4 comments, Views is 228

在使用 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、最后设置自己喜欢的快捷键即可

1.png

2.png

Responses
选择表情
  1. tom

    你的网站很漂亮,请问是自己写的还是哪个模板呢?感谢!

    Reply
    1. @tom

      Chakhsu Lau 的 Pinghsu 模板

      Reply
  2. 现在习惯了用sublime。。。 icon_smile.png

    Reply
    1. @Lvtu

      我也喜欢用sublime。但是ios开发还是xcode方便,只能在xcode里弄一些sublime的快捷键了 icon_confused.png

      Reply