Last Updated: February 25, 2016
·
208
· gilles-leblanc

Delete things faster in Visual Studio with these two weird tricks

Here are two nifty keyboard shortcuts in Visual Studio:

Cut whole line (Ctrl-L): This will cut/delete the whole line and send it to the clipboard. This is useful in two situations.

First, it let’s you remove a whole line in a single action reliably.

For white space lines, depending on the line configuration, using delete or backspace might necessitate more than a single key stroke per line. Ctrl-l always does it in one action.

For non white-space lines Ctrl-l prevents you from having to select the whole line and then deleting it, saving you again one action. Every action saved counts.

The second situation is when you want to select a whole line, cut it, move and then paste it. With Ctrl-l you can reduce this from 4 actions to 3.

When using Ctrl-l if you overwrite your current clipboard you can do a Ctrl-Shift-v to cycle through your clipboard history.

Delete next word (Ctrl-Del): This is a universal shortcut that works for many programs but I have included it here since I learned about it recently. This will delete the whole word in front of you instead of just a single character.