在 Visual Studio 中禁用 Shift+Delete 剪切
我打字很快。通常,在编程时,我会使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
很好的答案。尽管我假设有些人仍然喜欢执行删除操作。
要仍然使用 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.Visual Studio 中的键盘快捷键可以完全自定义。
转到
工具>选项
,然后在左侧选择环境>键盘
选择命令,选择要删除的快捷方式,单击“删除”,然后单击“确定”
,可以使用一行 AutoHotkey 脚本来转换Shift+Delete 为简单的Delete:
The keyboard shortcuts are pretty thoroughly customizable in Visual Studio.
Go to
Tools > Options
then in the left selectEnvironment > Keyboard
Select the command, select the shortcut you want to remove, click "Remove" and click "OK"
If you wanted to circumvent this across Windows, you can use a one-line AutoHotkey script to convert Shift+Delete to just plain Delete:
有一个更简单的方法。
快捷键 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.
这个自动热键脚本在全局范围内解决了这个问题:
shift+insert 还可以,但是shift+delete 简直是邪恶的,
我实际上经常完全丢失代码,同时完全困惑它去了哪里! :-)
This autohotkey script solve this globally:
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! :-)