为Xcode添加自定义快捷键

2018-09-22  本文已影响36人  一吻江山
  1. 复制/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist文件到桌面
  2. 自定义快捷键[编辑桌面上的IDETextKeyBindingSet.plist文件]
  3. 用编辑好的IDETextKeyBindingSet.plist文件替换/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist文件[需要输入密码才能替换成功]
  4. 重启Xcode,绑定快捷键
#1. 复制
cp /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist ~/Desktop

#2. 自定义快捷键
    <key>My Custom Actions</key>
    <dict>
        <key>Insert Line Below</key>
        <string>moveToEndOfLine:, insertNewline:</string>
        <key>Insert Line Above</key>
        <string>moveUp:, moveToEndOfLine:, insertNewline:</string>
    </dict>

#3. 替换IDETextKeyBindingSet.plist文件
sudo cp ~/Desktop/IDETextKeyBindingSet.plist /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist

参考:

上一篇 下一篇

猜你喜欢

热点阅读