Freigeben über


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: VS2005Tip, VS2008Tip

Comments

  • Anonymous
    September 27, 2007
    PingBack from http://www.artofbam.com/wordpress/?p=3592

  • Anonymous
    September 27, 2007
    ...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

  • Anonymous
    September 28, 2007
    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.

  • Anonymous
    September 28, 2007
    Good tip!  Thanks!

  • Anonymous
    September 28, 2007
    These have all been great, but this one just saved me at least 20 minutes a day. Keep it up, please.

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

  • Anonymous
    September 28, 2007
    The comment has been removed

  • Anonymous
    September 28, 2007
    Wow! You have no idea how frustrated I used to get by that behaviour! Keep up the good work and keep the tips coming.

  • Anonymous
    September 28, 2007
    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!-)

  • Anonymous
    September 28, 2007
    The comment has been removed

  • Anonymous
    September 28, 2007
    Too bad I use Control+X to clear empty lines for formatting purposes. They really should differentiate between Cut and Copy.

  • Anonymous
    September 28, 2007
    THANK you so much for this.

  • Anonymous
    September 28, 2007
    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. :)

  • Anonymous
    September 28, 2007
    Thanks! very nice tip :)

  • Anonymous
    September 28, 2007
    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.

  • Anonymous
    October 11, 2007
    The comment has been removed

  • Anonymous
    October 11, 2007
    Thanks...This is good!

  • Anonymous
    October 11, 2007
    Thanks a lot for tip this will surely do wonder for my frustration of loosing the data copied earlier

  • Anonymous
    November 01, 2007
    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!

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

  • Anonymous
    October 19, 2008
    Иногда что-то заставляет меня нажимать Ctrl+C вместо Ctrl+V, находясь на пустой строке. Не могу понять

  • Anonymous
    May 27, 2009
    Tip #0 Know your Keybindings! General Development Settings Searching Tips Tip #1 How to behold the power