0

我在 Xcode 4.5 中定义/自定义了一些键盘绑定,以便给我更好的打字体验。

只有捷径selectWord:是Xcode原来定义的,其他的都是我自己加的。它们在 Xcode 4.5 中运行良好。但是在我将 Xcode 更新到 4.6 之后,它们不再工作,除了selectedWordXcode 定义的。

键绑定文件位于/Users/jason/Library/Developer/Xcode/UserData/KeyBindings/Default.idekeybindings

<key>Text Key Bindings</key>
    <dict>
        <key>Key Bindings</key>
        <dict>
            <key>@
</key>
            <array>
                <string>moveToEndOfLine:</string>
                <string>insertNewline:</string>
            </array>
            <key>^$D</key>
            <array>
                <string>selectLine:</string>
                <string>copy:</string>
                <string>moveToEndOfLine:</string>
                <string>insertNewline:</string>
                <string>paste:</string>
                <string>deleteBackward:</string>
            </array>
            <key>^$K</key>
            <array>
                <string>deleteToBeginningOfLine:</string>
                <string>moveToEndOfLine:</string>
                <string>deleteToBeginningOfLine:</string>
                <string>deleteBackward:</string>
                <string>moveDown:</string>
                <string>moveToBeginningOfLine:</string>
            </array>
            <key>~w</key>
            <string>selectWord:</string>
        </dict>
4

1 回答 1

2

看来Xcode更新的时候,我们自己定义的快捷功能会被新版Xcode定义的默认快捷功能覆盖。总之,我们自己定义的捷径功能会消失,我们需要再做一次

1.我将以下代码添加回以/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist再次定义快捷方式功能。

  <key>Customerized</key>
  <dict>
    <key>Insert new line in middle</key>
    <string>moveToEndOfLine:, insertNewline:</string>
    <key>Duplicate Current Line</key>
    <string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
    <key>Delete Current Line</key>
    <string>deleteToBeginningOfLine:, moveToEndOfLine:, deleteToBeginningOfLine:, deleteBackward:, moveDown:, moveToBeginningOfLine:</string>
  </dict>

2.转到Xcode中的键绑定设置,并为它们键入新的快捷键。 在此处输入图像描述

于 2013-02-18T16:21:33.823 回答