xcode KeyBindingSet カスタマイズ

手順としては

  1. ターミナルを開いて $ open /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist を打つ
  2. /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist を読み書き可能に変更
  3. /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/ を読み書き可能に変更
  4. /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist を開いて追加したい内容書き込む
  5. xcode を再起動

新しいキーバインドの追加

/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist を開いて、以下を入力

~省略~

<key>customized</key>
    <dict>
      <key>Delete Current Line</key>
      <string>deleteToBeginningOfLine:, moveToEndOfLine:, deleteToBeginningOfLine:, deleteBackward:, moveDown:, moveToBeginningOfLine:</string>
    </dict>
    <key>Edit</key>
    <dict>
      <key>Duplicate Line</key>
      <string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
    </dict>
</dict>
</plist>

として保存。

追加した内容を反映

xcodeを再起動して、preferences を開いて KeyBindings を開いて、検索フォームに、上でで指定した単語を調べる。 そしたら、項目が出てくるので、好きなキーバインドを入力して終わり。