#88 Log your command window session

You can record your command window session via the log command.  Just run

log -on <filename>

and start recording.  To finish logging, it’s just

log -off

There is also an option to overwrite the existing file; otherwise it will append.  Note that both dash and forward slash will work for command arguments. 

Command Window displaying logging commands

#87 Run Visual Studio commands with arguments from the command window

After the past several weeks of Find tips (i knew i would have a few tips, just not nearly a month’s worth!), let’s change things up a bit and talk about the command window.

Press Ctrl+Alt+A to open the command window.  Check the keybinding for View.CommandWindow if your keybindings are different.  Also available from the View – Other Windows – Command Window.  Now you can run various Visual Studio commands without having to go through the menus. 

Examples:

>File.Open c:\samples\foo.txt  //Open a file without going through the menu. 
>Help vs.commandwindow  //open a help topic directly
>? i  // get the contents of the variable i
>? i = 10  // set the contents of the variable i

View the following help topic for a list of commonly-used commands that include arguments in VS 2005.  Also available in VS 2008 documentation.

Auto-completion is also provided for both the commands and their corresponding arguments.

Command Window Auto-completion for commands

You can also get auto-completion for arguments. 

Command Window Autocomplete for Arguments

#86 browse Find Symbol results

The results of a Find Symbol or a Quick Find Symbol will appear in the Find Symbol results.  Similar to the Find Results window (when searching for text), you can

press Ctrl+Alt+F12 to bring up the Find Symbols Results window (View.FindSymbolResults)
press F8 (Edit.GoToNextLocation) to navigate to the next result, and Shift+F8 (Edit.GoToPreviousLocation) to navigate to the previous result
press F12 (Edit.GoToDefinition) within the Results window to jump to that symbol in the editor
bring up the context menu and select Browse Definition to view in the object browser.  This command is Edit.BrowseDefinition (in case you want to bind it to a keyboard shortcut)

#85 Use Shift+Alt+F12 to do a Quick Find Symbol

Similar to yesterday’s tip on Find Symbol… select a word in the editor you want to do a Find Symbol on, then press Shift+Alt+F12.  No Find Symbol window will appear.  It is bound to Edit.QuickFindSymbol.

Quick Find Symbol command

The Quick Find Symbol uses the same customizations on the Find Symbol Window.  So, if you need to change scope for a Quick Find Symbol, make the customization on the Find Symbol window.

#84 Search for a symbol

Another search tip/trick or command is Symbol Search. This is much different than a string search. Watch this short video to learn about the built in Symbol Search in Visual Studio

Edit.FindSymbol is also bound to [Alt]+[F12]. You can search within your current solution (including or excluding references), or even within the .NET Framework.