在 Xcode 4 中,我已经成功地添加了新的自定义键盘快捷键来移动行或复制行:
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist
<key>My Custom Keys</key>
<dict>
<key>Move Line Up</key>
<string>selectLine:, cut:, moveUp:, moveToBeginningOfLine:, paste:, moveUp:</string>
<key>Move Line Down</key>
<string>selectLine:, cut:, moveDown:, moveToBeginningOfLine:, paste:, moveUp:</string>
<key>Duplicate Line</key>
<string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string>
<key>Delete Line</key>
<string>selectLine:, delete:</string>
</dict>
但是向上/向下移动行使用复制/粘贴,我想避免这种情况。任何人都知道如何用yank移动行,就像我在那里找到的Duplicate Line : Xcode duplicate line