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.

In the same series:

Search for things faster in Visual Studio with these two weird tricks

3 thoughts on “Delete things faster in Visual Studio with these two weird tricks

  1. If you’ve overwritten your clipboard by mistake Ctrl+Shift+v can go throught it. I think that thus clipboard history feature is worth a million.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s