Becoming a Visual Studio Jedi Part 1 - Peter Ritchie's MVP Blog

Becoming a Visual Studio Jedi Part 1

Becoming a Visual Studio 2008 (and often Visual Studio 2005) Jedi

In much the same grain as James' Resharper Jedi posts, I'm beginning a series of posts on becoming a Visual Studio Jedi.  It involves getting the most out of Visual Studio off-the-shelf, doing things as quickly as possible and with as little friction as possible.  I think it's useful for all users; but especially useful for those who are in situations where they can't install refactoring tools like Refactor Pro! or Resharper.

First, familiarize yourself with Sara's Visual Studio Tips blog; then subscribe to her blog.

I'll attempt to provide detail at a less granular level than Sara's blog (i.e. using a series of commands to perform a specific task); but I may overlap here and there

Take advantage of Auto-Hide
Like Jimmy Bogard and Jeffery Palermo, I have my Visual Studio UI very lean. 99% of the time, I'm working in code.  The Solution Explorer (SE), Properties, Output, etc are auto-hide panes.  When I need to use them I hover the mouse over the tab to make them visible, do what I need to do with them, then get back to the code.  The Code Editor is the only window that isn't auto-hide or floating.

Navigate find results via keyboard
Whenever anything is displayed in a find results window, you can iterate each item in the list via a keystroke.  The default C# keyboard map had F8 and Shift+F8 as the shortcuts for next and previous.

For example:

  1. Press Ctrl+Shift+F to bring up the Find in Files form.
  2. Enter "TODO\:.*refactor" in the "Find what" text box.
  3. Ensure Match case, Match whole word are unchecked.
  4. Ensure Use is checked and has Regular expressions selected.
  5. Press Alt+F to search.

A Find Results window is displayed that shows the results of the search.

  • F8 goes to the first result.
  • Pressing F8 again goes to the next.
  • Pressing Shift+F8 goes to the previous result.

See also:
http://blogs.msdn.com/saraford/archive/2008/04/18/did-you-know-you-can-use-f8-and-shift-f8-to-navigate-among-errors-in-the-output-window.aspx
http://blogs.msdn.com/saraford/archive/2007/11/08/did-you-know-how-to-use-f8-to-navigate-the-find-results-window.aspx
http://blogs.msdn.com/saraford/archive/2005/03/30/403887.aspx

F8 and Shift+F8 work for most lists like Find Results 1, Find Results 2, Error List, Output:Build, etc.

File name extensions when adding classes
Do you find your self selecting text in the file name when you use the Add Class wizard?  Or, do you always type ".cs" at the end of your file name?  You may be happy to know you don't have to do that.  Simply invoke the Add Class wizard and type the name of the class.  The wizard adds the missing .cs for you.  For example:
Press Alt+P, C
Enter "MyNewClass"
Press Enter
A file MyNewClass.cs is added to your project and it contains class named "MyNewClass".

Consider a Custom toolbar

There's generally only handful of toolbar buttons that you might need, especially if you're a keyboard user like me.  There's some things that simply don't have a default keyboard mapping.  Another good reason for having a custom toolbar item with only the buttons you use is if you often change the size of your Visual Studio window.  The default layout has two or more toolbars (depending on the edition and any add-ins you have installed).  You can carefully position those toolbars so they may take up one or two lines; but when you then shrink the size of your window the get wrapped and they won't restore if you expand the size of your window.  Having a single toolbar means this wrapping of toolbars can never happen.

Export Settings

Once you get your UI the way you want it, you can actually save the layout. 

  1. Click on Tools\Import and Export Settings.
  2. Select Export selected environment settings.

This is really handy if you get into low-resource situations (like the application you're developing or its framework uses up too many GDI handles and Visual Studio can't allocate a handle to display a toolbar or a frame.  When this happens Visual Studio actually turns off those GUI elements; when you close and restart those panes/frames are no longer displayed by default.)

DotNetKicks Image

Comments

# re: Becoming a Visual Studio Jedi Part 1

I have a blog entry with some useful level 200 keystrokes/chords which you might find useful as well.

www.pchenry.com/.../Default.aspx

I say level 200 cause I skip the usual F7, CTRL+E, D and other ones.  There is also two suggestions there about VERY useful keystrokes for when you do forget keystrokes (everyone has THOSE days when you just can't remember what THAT keystroke was, these two will save you!).

I look forward to the next posts on this topic!

Tuesday, September 02, 2008 4:20 PM by PHenry

# Arjan`s World » LINKBLOG for September 3, 2008

Pingback from  Arjan`s World    » LINKBLOG for September 3, 2008

Wednesday, September 03, 2008 3:37 PM by Arjan`s World » LINKBLOG for September 3, 2008

# re: Becoming a Visual Studio Jedi Part 1

Really cool post! I think I'm a VS jedi yet!! :)

I think.. but I'm waiting for the second part :P

Thursday, September 04, 2008 3:01 PM by Davide Espertini

# re: Becoming a Visual Studio Jedi Part 1

Additionally, turn off your shell animations too.  Sliding effect is so awesome, but not practical.

Monday, September 08, 2008 9:47 AM by charris

# re: Becoming a Visual Studio Jedi Part 1

disable all the toolbars.  they are a waste of space.  customize the menus by adding the solution configurations (debug/release) and maybe the solution platforms to the build menu.  You need to change those, what, once or twice a day?

and if you can't use Resharper, then you are working in the wrong environment.  visual studio is a good starting point, but without the added power of Resharper, it is distinctly lacking...

Monday, September 08, 2008 8:11 PM by dadsit

# re: Becoming a Visual Studio Jedi Part 1

Use at least a 24" monitor - Two of them is better.

Tuesday, September 09, 2008 10:29 PM by Dave

# re: Becoming a Visual Studio Jedi Part 1

Thanks You , Perfect Docs

Wednesday, September 10, 2008 12:14 PM by Turkey

# Visual Studio 2010, Enhance your Jedi Skillz

I’ve blogged about becoming a Jedi in Visual Studio 2008 before . Being a Jedi in Visual Studio

Thursday, June 17, 2010 11:25 AM by Peter Ritchie's MVP Blog

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: