XCode中的多行光标移动 [英] Multiple-line cursor movements in XCode

查看:290
本文介绍了XCode中的多行光标移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想映射一个键,以将XCode中的光标向上移动十行.当然,我也想让另一个人下移.理想情况下,键映射应类似于"Control-Alt-P".

I'd like to map a key to move the cursor in the XCode up by ten lines. Of course, I want another one to move down too. The key mapping would ideally be something like 'Control-Alt-P'.

是否有一种无需借助Automator即可在XCode中实现此目标的方法?

Is there a way to achieve this in XCode without resorting to Automator?

Ashley的回答如下,由于属性列表采用XML格式,因此格式略有不同.

Ashley has the answer below, the formatting was a little different as the property list is in XML format.

总而言之,将以下格式的条目添加到〜/Library/Application Support/Xcode/Key Bindings/中的* .pbxkeys的文本"部分:

In summary, added an entry in the following format to the 'text' section of *.pbxkeys in ~/Library/Application Support/Xcode/Key Bindings/:

    <key>^~p</key>
    <array>
        <string>moveUp:</string>
        <string>moveUp:</string>
    </array>

推荐答案

您可以使用给出的示例

You can use the example given here and use a DefaultKeyBinding.dict file, except use moveUp: and moveDown: as your selectors.

您的特定词典条目如下所示:

Your particular dictionary entry would look something like this:

{
    "^~P" = (
        "moveUp:",
        "moveUp:",
        "moveUp:",
        ... however many times ...
        "moveUp:",
    );
}

此后,我了解到,如果您已经通过Xcode自定义了键绑定,则应该在text词典部分的.pbxkeys文件中添加相同的词典条目.

I have since learned that if you have customized your keybindings through Xcode already you should instead add the same dictionary entry to your .pbxkeys file under the text dictionary section.

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

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