Xcode重复/删除行 [英] Xcode duplicate/delete line
问题描述
我知道可以更改系统范围的键盘,但这不是我以后的。
整点不是使用 Cmd-C
/ Cmd-V
快捷方式。我有同样的问题来自IntelliJ,并且只能用 Cmd-D
重复行,并用 Cmd-Y
是一个很大的节省时间。
从那以后,我一直在欺骗我。不过,其他人似乎找到了一个解决方案。简单来说,创建一个文件〜/ Library / KeyBindings / PBKeyBinding.dict
,并重新启动Xcode 。
{
^ $ K=(
selectLine:,
cut:
);
^ $ D=(
selectLine:,
copy:,
moveToEndOfLine:,
insertNewline: ,
paste:,
deleteBackward:
);
}
这将创建两个快捷方式: Ctrl - < kbd> Shift - K 用于删除当前行, Ctrl - Shift - D 当前行。请注意,如果您使用Xcode中的自定义键绑定设置不,则仅可以正常工作。切换到XCode默认,事情应该工作。在雪豹XCode 3.2上测试。
有关Mac OS X键绑定的更多信息: http://funkworks.blogspot.it/2013/03/republishing-of-wwwerasetotheleftcompos.html
Coming from Eclipse and having been used to duplicate lines all the time, it's pretty strange finding out that Xcode has no such function. Or does it?
I know it's possible to change the system wide keybindings but that's not what I'm after.
The whole point is NOT to use the Cmd-C
/Cmd-V
shortcuts. I have the same issue coming from IntelliJ, and being able to just duplicate lines with Cmd-D
and delete them with Cmd-Y
is a big time saver.
It's been bugging me ever since. However, it looks like someone else has found a solution that works.
In short, create a file ~/Library/KeyBindings/PBKeyBinding.dict
with the following content and restart Xcode.
{
"^$K" = (
"selectLine:",
"cut:"
);
"^$D" = (
"selectLine:",
"copy:",
"moveToEndOfLine:",
"insertNewline:",
"paste:",
"deleteBackward:"
);
}
This will create two shortcuts: Ctrl-Shift-K for deleting the current line and Ctrl-Shift-D for duplicating the current line. Please note that this will only work if you are NOT using a custom key binding set in Xcode. Switch to "XCode Default" and things should work. Tested on XCode 3.2 on Snow Leopard.
More information on Mac OS X key bindings: http://funkworks.blogspot.it/2013/03/republishing-of-wwwerasetotheleftcompos.html
这篇关于Xcode重复/删除行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!