7 Valuable Visual Studio Hidden Features

Trusted By

Welcome Back! I hope you enjoy the content on this site. If you have not done so already, you may want to subscribe to my RSS feed or become a fan of this blog on Facebook. Thanks for visiting!

Visual Studio is a very powerful IDE and I have yet to find another IDE that comes close to all the features it offers. Yet they are some hidden gems that can make our every day tasks a little bit easier.

  1. Under “HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor” Create a String called “Guides” with the value “RGB(255,0,0), 80″ to have a red line at column 80 in the text editor.
  2. Pressing ALT during selection, selects a square of text instead of whole lines.
  3. Ctrl++ [Control, Plus] or Ctrl+- [Control, Minus] to navigate to previous position of the cursor and back
  4. Ctrl+Shift+V to cycle through the Clipboard history. Visual Studio keeps a history of data in the clipboard
  5. Ctrl+U and Ctrl+Shift+U to uppercase or lower case selected text.
  6. Ctrl+L Deletes the current line.
  7. Shift+F9 to bring the variable in QuickWatch

Hope this Helps.

Hatim

10 Comments

The Alt-select to get a column is nice, but it would be even better if you could edit in this mode. Many editors have supported this for many, MANY years, but I have yet to see it working in VS.

[...] 7 Valuable Visual Studio Hidden Features - Hatim gathers together 7 of the less well known features in Visual Studio - I particularly find the ruled column ijn the editor and the Ctrl++ and Ctrl+- tricks useful. [...]

James Hollingworth

May 1st, 2009
at 8:46am

awsome tip’s. the only one i’m perplexed by is the red line on col 80, why would you need that?

James,
Thank you! The red line on col 80 is a formatting and historic thing to have all the lines fit in a printed page. Also depending on the screen resolution it avoids scrolling horizontally which can be a pain.

In fact, Ctrl+L cuts the current line, the same Shift+Delete. To delete the current line without to cut it, use Shift+Ctrl+L.

[...] 7 Valuable Visual Studio Hidden Features – Hatim [...]

Eugene Rimmer

May 1st, 2009
at 9:54pm

Maaan, cmon, you gotta try at least some general source editors out there, not even speaking of other IDEs. Believe me they are all stuffed with things like that. There are even more amasing things out there. For example, you can (believe it or not) swap the lines or even whole fragments of code - with a single keystroke. You can type ‘if’, press a magic key and voila! - the whole if() construction with all its wierdies and curlies all around pops into your code. When there’s only one identifier that fits the initial part you typed, and you willingly call Code Assist - it will type the identifier to its end witout dumb asking you to select among one variant. Or you named a function one way, then your manager asked you to rename it, but you already used it a zillion places elsewhere, no Find and Replace helps you now… Pas des problemes! You stroke a couple of keys, RETYPE the name of the function, and - oh goodness, it renamed correctly everywhere… No, check it - it compiles!

Boy, there are so many things… I wonder did MS implement them all…

To get the if thing, assuming you have the out-of-the-box `if’ snippet installed, type
if
then press tab, tab, and viola! the whole if() construction! This also works with
for (i = 0; i Options > Environment > Keyboard). Navigate forward and backward are even on the View menu at the top of the screen! There are LOTS more goodies than this if you take the time to find out what they mean.

BTW, if anyone knows how to write addins for VS 2008 (or even an earlier version), let me know.

Why did this blog remove lots of my post!?
I meant to say that the `for’ insert (`for’, tab, tab) also works backwards (`forr’, tab, tab). and also
My only complaint is that only one of these is an hidden feature, the registry entry. The others are all easily available in (then the original post resume with Options > Environment…).

On second thought, the alt select thing seems to be an hidden feature, too… I spoke too soon.

Leave a Comment