Tips and Tricks: Apply (or Don’t Apply) Cut or Copy commands to blank lines

Visual Studio Blog

As you may know, Visual Studio’s cut and copy commands are useful for more than just selected text.  If you invoke them when there is no selection, VS will cut or copy your entire line, which saves you the trouble of selecting the line before adding it to the clipboard.  Although a lot of developers find this helpful, we occasionally hear feedback that this feature becomes annoying when Visual Studio clears your clipboard if you accidentally hit Ctrl+X or Ctrl+C on a blank line with no selection.  Fortunately, there’s an option for that:

Apply Cut or Copy commands to blank lines when there is no selection

If you often find yourself copying blank lines to the clipboard and erasing the previous clipboard contents, try navigating to Tools->Options->Text Editor->[All Languages or your favorite language]->General and unchecking “Apply Cut or Copy commands to blank lines when there is no selection.”  You’ll still have the convenience of cutting or copying entire lines to the clipboard without the risk of unintentionally replacing your clipboard contents with white space.  And if you do inadvertently end up with a blank clipboard, the Clipboard Ring feature can often paste your previous text without requiring you to recopy it.

If you like the tips and tricks we sometimes post on this blog, you might also be interested in the Visual Studio Tips and Tricks blog, which is devoted to these little productivity boosters.  There’s even a Tip of the Day Start Page extension for the VS 2010 RC – check it out and let us know what you think!

Brittany Behrens Program Manager, Visual Studio Editor Team

clip_image002I’m Brittany, a Program Manager on the Visual Studio Editor team.  Some of you may recognize me from Connect bugs or as the main voice of @VSEditor on Twitter, and I’m responsible for a variety of Editor features.  I love hearing from customers, so please let me know what you think!


Discussion is closed.

Feedback usabilla icon