在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>
但 Move Line Up / Down 使用复制/粘贴,我想避免。任何人都知道如何使用 yank 移动线条,就像我在那里找到的重复线:Xcode duplicate line
答案 0 :(得分:119)
从https://stackoverflow.com/a/9078952/852828复制,因为这不是链接副本的已接受答案。
Xcode 4有一组新的命令用于移动光标所在的行或选定的文本
command
+option
+[
或]
⌥⌘[
或⌥⌘]
答案 1 :(得分:0)