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: 900X580 - 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) so far

  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!

Post your comment

Thanks for your comments


Be nice ;)

  • Comment

Main RSS Feed (All Posts)

Scott Cate Main Blog FedSample topics include personal, work, community, technology, and Video Tricks.

Visual Studio Tricks Feed (New)

Scott Cate Visual Studio Tricks RSS FeedOnly contains Visual Studio Tricks. These are 99% video tricks!

Technology RSS Feed

Scott Cate Technology FeedTechnology Only! Tips, Tricks, Programming, Tech Events, and other geeky subjects.

Want Email Notifications of New VSTricks

What is your email?

Twitter @ScottCate

  • My 4 year old: daddy why is a hammer called a hammer? You don't ham things with it; you bam things. It should be called a bammer ;)
  • @jonsagara Thank you!
  • Costco has QuickBooksPro 2010 for $145 http://goo.gl/cLtX That seems like a pretty good deal - everywhere else I've seen has it for $180+
  • Installing my first ever 64 bit OS, with Win7 Ultimate, on my MacBookPro 17. Any words of wisdom for me?
  • I'm thankful we don't have to pay the Build Servers for the work they do. We'd be broke!

Twitter @VSTricks

  • RT @zainnab: Visual Studio 2010 Tips and Tricks Begins!: Happy to announce that the New Year marks the beginning .. http://bit.ly/8pZh0O
  • Congratulations to all @VSTricks entries. @Kazuk was the winner. Video shows how the random was done http://bit.ly/8EDCwW (if u care)
  • @kazuk Congrats - you are the winner - video being posted shortly - please DM me your email
  • @leemessenger @ericfickes @DarrellHardy Trick 504 has been fixed. No login needed. http://bit.ly/71OGcF
  • OK Everyone! Trick 504 is fixed! No user/pwd needed. Debug ASP.net in any browser with #VisualStudio http://bit.ly/7QaCSi

GetClicky Web Stats

Web Analytics