48

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?

Lukazoid
  • 19,016
  • 3
  • 62
  • 85
Ronnie Overby
  • 45,287
  • 73
  • 267
  • 346

4 Answers4

50

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.

Shawn Chin
  • 84,080
  • 19
  • 162
  • 191
stvn
  • 1,148
  • 1
  • 8
  • 24
45

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}
Macke
  • 24,812
  • 7
  • 82
  • 118
Jay
  • 56,361
  • 10
  • 99
  • 123
  • how do I find my hotkey inbetween those 10000000 entries? – Liquid Core Jul 19 '13 at 10:33
  • 5
    @user2212907 You can search in the box that says "Show commands containing." If you are trying to find out which command is using a particular hotkey, you can enter that hotkey in the box that says "Press shortcut keys" as though you are going to assign it. At the bottom of a dialog is a dropdown that will show the command(s) to which the hotkey is already assigned. – Jay Jul 19 '13 at 12:44
  • 2
    Edit.Cut has two shortucts: Ctr+X and Shift+Del. I removed Shift+Dl from cut and assigned it to Edit.LineDelete. – scar80 Apr 16 '18 at 12:58
  • +1 This answer also works in Programmer's Notepad: Go to `Tools->Options`, select `Keyboard` and scroll down until you find `Edit -> Cut`, then just delete the `Shift+Del` shortcut. – indextwo Apr 21 '19 at 09:53
  • Not exactly related to question, but I find myself updating clipboard with some random content pretty often. That's why I started to use Ditto (but there are more clipboard managers available), it literally saves lives! – Sebastian Budka Mar 13 '20 at 12:01
3

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.

Mwiza
  • 7,780
  • 3
  • 46
  • 42
Torben Junker Kjær
  • 4,042
  • 4
  • 34
  • 33
1

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

Dany0
  • 11
  • 1