Tips and Tricks: Apply (or Don’t Apply) Cut or Copy commands to blank lines
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:
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!
Program Manager, Visual Studio Editor Team