Welcome to MSDN Blogs Sign in | Join | Help

Sara Ford's WebLog


My adventures embracing open source on CodePlex and at Microsoft

News

Did you know... how not to accidentally copy a blank line? - #050

There's something about me that keeps hitting Ctrl+C instead of Ctrl+V whenever i'm on a blank line.  I just don't understand it.  So, what happens is I copy a blank line, erasing the text i was trying to paste right there.  And to my dismay, i hit Ctrl+V and nothing happens.

The option that saved my sanity is found in Tools - Options - Text Editor - All Languages - General.  There's a checkbox Apply Cut or Copy commands to blank lines when there is no selection.  Unchecking this allowed me to hit Ctrl+C all i want on a blank line without losing the content on my clipboard. 

Option to turn off copying / cutting blank lines

Technorati tags: ,
Posted: Friday, September 28, 2007 3:00 AM by saraford

Comments

Matt H said:

...and don't forget that CTRL+SHIFT+V will cycle through everything you've copied. So you'll still be able to paste in that thing you copied a few copies ago!!?? :-D

# September 28, 2007 6:28 AM

Jens said:

Thank you very, very, veyr, very much.

You really can't believe how much this behaviour (which is inconsistent with about every other Windows Application) has annoyed me since VS.NET 2002.

# September 28, 2007 8:21 AM

slee said:

Good tip!  Thanks!

# September 28, 2007 8:25 AM

Bill Wagner said:

These have all been great, but this one just saved me at least 20 minutes a day.

Keep it up, please.

# September 28, 2007 8:35 AM

Bill Blogs in C# said:

Sara Ford has been posting tips about the VS 2005 editor. Today's tip( http://blogs.msdn.com/saraford

# September 28, 2007 8:38 AM

potiguar said:

Now that's a VERY useful tip! Thanks Sara! I keep cutting those empty lines all the time!

# September 28, 2007 8:45 AM

Tim Greaves said:

Wow! You have no idea how frustrated I used to get by that behaviour!

Keep up the good work and keep the tips coming.

# September 28, 2007 8:58 AM

Skip Valentine said:

Excellent Tip!!!! I fumble-finger that one all of the time too! Man..., makes me want to go copy-n-paste some lines right now!-)

# September 28, 2007 9:22 AM

Jason Haley said:

# September 28, 2007 10:02 AM

Jason said:

Mucho gracias!  That has been one of the annoying "features" of VS for a long time.  Drives me nuts each time it happens.  Glad to see that it can be turned off.

# September 28, 2007 10:04 AM

Brian Lowry said:

Too bad I use Control+X to clear empty lines for formatting purposes. They really should differentiate between Cut and Copy.

# September 28, 2007 10:45 AM

MisterStinky said:

THANK you so much for this.

# September 28, 2007 12:42 PM

Richard Sim said:

I'm quite surprised to hear that so many people don't like the default behaviour - personally I use that behaviour probably as often as the "normal" selection copy/cut behaviour. I love it. :)

# September 28, 2007 8:46 PM

Muhamamd Qasim Pasta said:

Thanks! very nice tip :)

# September 29, 2007 6:09 AM

Matt Casto said:

You could use a utility like <a href="http://mattcasto.blogspot.com/2007/01/clipboard-recorder.html">Clipboard Recorder</a> and never worry about losing what's currently in your clipboard again.  It's very liberating to just copy a few lines of code you know you'll need later and forget about it.

# September 29, 2007 7:38 AM

Deepak Raghavan said:

I have done this a few times in the past as well. Typing Ctrl + C instead of Ctrl + V on a blank line

# October 11, 2007 10:35 PM

Deepak said:

Thanks...This is good!

# October 11, 2007 10:36 PM

vik20000in said:

Thanks a lot for tip this will surely do wonder for my frustration of loosing the data copied earlier

# October 12, 2007 12:14 AM

Morten Haug said:

Brian Lowry said: "Too bad I use Control+X to clear empty lines for formatting purposes. They really should differentiate between Cut and Copy."

Use Shift-delete instead!

# November 1, 2007 5:28 PM

Visual Studio 2008 ワンポイント said:

私はなぜか、空白行で Ctrl + V キーの代わりに Ctrl + C キーを押してしまうことが多いのです。理由はわかりません。その結果、空白行がコピーされ、私がそこに貼り付けようとしていたテキストは消えてしまいます。

# June 16, 2008 1:15 AM
New Comments to this post are disabled
Page view tracker