开发者

Disable Shift+Delete Cutting in Visual Studio

开发者 https://www.devze.com 2023-04-12 09:32 出处:网络
I type fast. Often times when programm开发者_JS百科ing 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. Thi

I type fast. Often times when programm开发者_JS百科ing 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?


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.


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"

Disable Shift+Delete Cutting in Visual Studio

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}


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.


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! :-)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号