Ronnie Overby
Ronnie Overby

Reputation: 46460

Disable Shift+Delete Cutting in Visual Studio

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?

Upvotes: 52

Views: 9814

Answers (4)

Torben Junker Kjær
Torben Junker Kjær

Reputation: 4072

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.

Upvotes: 3

Dany0
Dany0

Reputation: 11

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

Upvotes: 1

Jay
Jay

Reputation: 57899

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}

Upvotes: 50

stvn
stvn

Reputation: 1198

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.

Upvotes: 54

Related Questions