Visual Studio Tricks


Visual Studio (2005,2008,2010) Tips and Tricks.


#50 How not to accidentally copy a blank line in Visual Studio

We all use CTRL+C and CTRL+V everyday, 1000 times. It's one of the first things you have to learn as a programmer to keep you hands on the keyboard. It's easy to sometimes press CTRL+C again, when in fact it's time to Paste, so you really meant to press CTRL+V. Visual Studio will allow you to copy a blank line. So it what you're trying to paste, is onto a new blank line, and you accidentally press CTRL+C, you'll copy the blank line, then your CTRL+V is lost. (Oh but tip #51 Shows you the clipboard ring). Anyway - this tip tells Studio to not copy blank lines.

Click Screenshot To Play Video

#50 How not to accidentally copy a blank line in Visual Studio

Runtime: 1Minute - Resolution: 900 by 580 - File Size: 1.2Meg

Direct Download: If the video does not work for you,
Click Here to download it.

Snippets / Notes:

This work is licensed under a Creative Commons license.

Visual Studio Tip / Trick #050 English Transcription:

Today's Visual Studio Trick of the day, trick no. 50 was originally recorded by Sara Ford in September 2007. The trick is copy paste on a blank line. So if you have some text copied on your clip board, [CTRL]+[C] and you go down to a blank line and accidentally press [CTRL]+[C] again, now if you try to paste, you are gonna paste that blank line. Now we know that [CTRL]+[SHIFT]+[V] to get through our clipboard ring. Or we can go to Tools -> Options and under Text Editor -> All Languages, there's an option here that says "Apply Cut or Copy commands to blank lines when there is no selection". And if you turn that off, now you can [CTRL]+[C] on a blank line and that won't take affect because you have that option turned off. I have confirmed that works the same in Visual Studio 2008 as in 2005. Works the same in both versions.
Kick this Trick on DotNetKicks.com

2 comment(s)

  1.  avatar

    Thank you very much for this tip! I've always hated that visual studio copies blank lines, I'm turning that option off right now!


RSS Feeds

All Technology Posts

Scott Cate Main Blog Feed


Visual Studio Tricks Only Feed

@ScottCate on Twitter

Twitter @ScottCate