问题描述
有人问过相同的问题要求输入Xcode 3 但是据说那里的解决方案不适用于Xcode4.而且那里没有新的解决方案.
The same question has been asked for Xcode 3But the solution there is said to not work with Xcode4. And no new solution is available there.
如何获取键绑定以在Xcode 4中将光标向上/向下移动约10行?
How to get a key-binding to move the curser up/down about 10 lines in Xcode 4 ?
推荐答案
尤里卡!受 answer on行复制的启发,这就是通过多行移动为Xcode 4赋权的方式:
Eureka! Inspired by the answer on line duplication, this is how you empower Xcode 4 with multiple-line movement:
- 转到文件夹
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources
- 打开
IDETextKeyBindingSet.plist
. - 添加一个新词典
Customized
和两个新命令(例如Move Down 10
和Move Up 10
)键,如下图所示: - 重新启动Xcode并转到首选项-按键绑定",搜索您的命令.
-
设置两个命令的组合键:
- Go to the folder
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources
- Open
IDETextKeyBindingSet.plist
. - Add a new dictionary
Customized
and two new command (say,Move Down 10
andMove Up 10
) keys as the screenshot below: - Restart Xcode and go to Preferences - Key Bindings, search for your command.
Set a key combination for both commands:
最终摆脱了Jump To
快捷方式的束缚.享受吧!
Free at last from the shackles of the Jump To
shortcut. Enjoy it!
奖金:系统范围内的多行移动
执行以下步骤,将光标释放到Xcode外部:
Bonus: system-wide multiple-line movement
Unleash the cursor outside Xcode following with these steps:
- 转到文件夹
~/Library/KeyBindings
- 打开
DefaultKeyBinding.dict
. - 输入以下内容.根据需要进行自定义.
- Go to the folder
~/Library/KeyBindings
- Open
DefaultKeyBinding.dict
. - Enter the following. Customize as appropriate.
"^〜n" =("moveUp:","moveUp:","moveUp:","moveUp:","moveUp:","moveUp:","moveUp:","moveUp:", "moveUp:","moveUp:");
"^〜p" =("moveDown:","moveDown:","moveDown:","moveDown:","moveDown:","moveDown:","moveDown:","moveDown:","moveDown: ","moveDown:");
"^~n" = ("moveUp:", "moveUp:", "moveUp:", "moveUp:", "moveUp:", "moveUp:", "moveUp:", "moveUp:", "moveUp:", "moveUp:");
"^~p" = ("moveDown:", "moveDown:", "moveDown:", "moveDown:", "moveDown:", "moveDown:", "moveDown:", "moveDown:", "moveDown:", "moveDown:");
}
以上所有内容均适用于Xcode 4.5.1.10.8.2.
All of the above works on 10.8.2 with Xcode 4.5.1.
这篇关于XCode 4中的多行光标移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!