在 Visual Studio 中禁用 Shift+Delete 剪切

发布于 2024-12-09 15:44:03 字数 387 浏览 1 评论 0原文

我打字很快。通常,在编程时,我会使用 Shift+End 选择一行,然后按 delete 键,但我执行此操作的速度太快了,以至于我的手指尚未脱离 shift 键。这会导致剪贴板项目替换为所选项目。

这很糟糕,因为很多时候我在粘贴其他代码之前删除代码。

显然 shift+del 是一种老式的剪切方式。

我知道 ctrl+shift+v 用于在 Visual Studio 中循环浏览剪贴板历史记录,但这仍然非常烦人。

有没有办法在 Visual Studio 或 Windows 中禁用此快捷方式?

I type fast. Often times when programming I will select a line with Shift+End and then press the delete key, but I do this so quickly that my finger hasn't come off of the shift key. This results in replacing clipboard item with what was selected.

This is bad because many times I am deleting code before pasting some other code.

Apparently shift+del is an old school way of cutting.

I am aware of ctrl+shift+v for cycling through clipboard history in visual studio, but this is still terribly annoying.

Is there a way to disable this shortcut in visual studio or windows in general?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

晨敛清荷 2024-12-16 15:44:03

很好的答案。尽管我假设有些人仍然喜欢执行删除操作。

要仍然使用 SHIFT+DEL 执行整行擦除,但不将其添加到剪贴板:

删除(如上所述)SHIFT+DEL 到Edit.Cut 命令

并将

SHIFT+DEL 组合绑定到 Edit.LineDelete 命令。

Good answer. Although I assume some people will still like to perform the delete operation.

To still perform the wipe of the entire line with SHIFT+DEL but don't add it to the clipboard:

remove (as explained above) the binding of SHIFT+DEL to the Edit.Cut command

AND

bind the SHIFT+DEL combination to the Edit.LineDelete command.

染年凉城似染瑾 2024-12-16 15:44:03

Visual Studio 中的键盘快捷键可以完全自定义。

转到工具>选项,然后在左侧选择环境>键盘

选择命令,选择要删除的快捷方式,单击“删除”,然后单击“确定”

,可以使用一行 AutoHotkey 脚本来转换Shift+Delete 为简单的Delete

+DELETE::SendInput,{DELETE}

The keyboard shortcuts are pretty thoroughly customizable in Visual Studio.

Go to Tools > Options then in the left select Environment > Keyboard

Select the command, select the shortcut you want to remove, click "Remove" and click "OK"

enter image description here

If you wanted to circumvent this across Windows, you can use a one-line AutoHotkey script to convert Shift+Delete to just plain Delete:

+DELETE::SendInput,{DELETE}
撩起发的微风 2024-12-16 15:44:03

有一个更简单的方法。
快捷键 CTRL+SHIFT+L 只是删除您所在的行。无需先选择它,也无需将其复制到剪贴板。

There is an easier way.
The shortcut CTRL+SHIFT+L simply deletes the line you're on. Without having to select it first and without copying it to the clipboard.

新一帅帅 2024-12-16 15:44:03

这个自动热键脚本在全局范围内解决了这个问题:

+Delete::
KeyWait Shift
Send {Delete}

shift+insert 还可以,但是shift+delete 简直是邪恶的,

我实际上经常完全丢失代码,同时完全困惑它去了哪里! :-)

This autohotkey script solve this globally:

+Delete::
KeyWait Shift
Send {Delete}

shift+insert is okay, but shift+delete is just plain EVIL

I actually often lost code entirely, while being utterly confused where'd it go! :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文