Xcode:删除行热键 [英] Xcode: Delete line hot-key

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

问题描述

我正在寻找一种映射一些热键的方式,以在Xcode中删除光标所在的行".我在文本键绑定中找到了删除到行尾"和删除到行首",但是无论我选择了什么,我都找不到如何完全删除该行的方法. TextMate将此功能映射到Ctrl + Shift + D,如果可能,我想做同样的事情.有什么想法吗?

I'm looking for a way to map some hot-keys to "delete the line that my cursor is on" in Xcode. I found "delete to end of line" and "delete to beginning of line" in the text key bindings, but I am missing how to completely delete the line no matter what I have selected. TextMate has this functionality mapped to Ctrl+Shift+D and I'd like the same thing if possible. Any ideas?

推荐答案

您可以设置系统范围的密钥绑定文件,该文件将应用于所有Cocoa应用程序.

You can set up a system-wide key binding file that will apply to all Cocoa apps.

要做您想做的事情应该像这样:

To do what you want it should like like this:

在您的主文件夹中,Library/KeyBindings/DefaultKeyBinding.dict

In your home folder, Library/KeyBindings/DefaultKeyBinding.dict

{
    "^D" = (
        "moveToBeginningOfLine:",
        "deleteToEndOfLine:",
    );
}

我相信,如果只希望将其应用于Xcode,则可以将文件命名为PBKeyBinding.dict,但是我自己没有尝试过.您可以在此处 a>和这里.

I believe if you only want it to apply to Xcode you can name the file PBKeyBinding.dict instead but I didn't try that myself. You can read more about this system here and here.

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

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