Xcode重复行 [英] Xcode duplicate line

查看:200
本文介绍了Xcode重复行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在编辑菜单中, ),但它是(正如 Halley 指出的)意图在Xcode的Interface Builder部分中重复。

There is a Duplicate command in the Edit Menu (with a default shortcut of D), but it is (as Halley pointed out) meant for duplication in the Interface Builder part of Xcode.

那么,您如何(轻松地)在Xcode 4中复制一行?

So, how do you (easily) duplicate a line in Xcode 4?

相关问题(有一个工作的答案)Xcode 3 ...并且不适用于Xcode 4。

Related question (with a working answer) for Xcode 3 ... and which does not work for Xcode 4.

因为它是乏味的,需要太多的手工杂技:

Because it is tedious and entails too much hand-acrobatics:

(1 ):移动到行开始,然后按⇧^ E ,然后使用⌘C复制,移动到新行,调整光标和 粘贴⌘V;

either (1): moving to line beginning and then pressing ⇧^E, then copying with ⌘C, moving to new line, alligning cursor, and finally pasting with ⌘V;

(2) ^ A < kbd>(将光标设置为行开始), ^ SPACE (设置标记), ^ E (将光标设置为行尾),⇧^ W 选择标记;定制),复制,新行等。

or (2): ^A (set cursor to line begining), ^SPACE (set mark), ^E (set cursor to line ending), ⇧^W (Select to Mark; customized), copy, new line, etc.

作为FrankSchröder(在相关问题)表示:

As Frank Schröder (in the related question) put it:


整点不是使用Cmd-C / Cmd-V快捷方式。

The whole point is NOT to use the Cmd-C/Cmd-V shortcuts.


推荐答案


  1. 转到包含黑暗面的文件夹:


    • Xcode 4.2或pri或者: /Developer/Library/PrivateFrameworks/IDEKit.framework/Resources

    • Xcode 4.3:我不知道,也许这是 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources 。我现在没有可以使用的狮子机器,稍后我会看这个。

  1. Go to this folder which contains dark side of the force:
    • Xcode 4.2 or prior: /Developer/Library/PrivateFrameworks/IDEKit.framework/Resources
    • Xcode 4.3: I don't know, maybe it's /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources. I don't have Lion machine available at this moment... I will look at this when I have a chance later.

添加一个新的字典和一个新的命令项作为下面的截图(命名为你想要的):

Add a new dictionary and a new command item as the screenshot below (name them what you want):

那是: selectLine :, copy :, moveToEndOfLine :, insertNewline :, paste :, deleteBackward:

重新启动Xcode并转到首选项 - 密钥绑定,搜索您的命令。

Restart Xcode and go to Preferences - Key Bindings, search for your command.

设置命令的组合键:

Set a key combination for the command:

最后释放了Xcode上的键绑定功能...享受吧!

Finally unleashed the power of key bindings on Xcode... Enjoy it!

这篇关于Xcode重复行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆