Archives for May 2010

#79 Use F8 to Navigate the Find Results window

You’ve probably noticed that doing a Find in Files returns all the hits in a Find Results tool window.  Did you know, you can use [F8] (with focus either in the Find Results window or in the editor) to navigate to the next result or [SHIFT]+[F8] to the previous result.  (Edit.GoToNextLocation and Edit.GoToPrevLocation) The video is pretty helpful for the visual – but this is a trick you’ll want to remember, I use it 100’s of times a day.

Oh, and yes, you can do a quick find [CTRL]+[F3] within the Find Results window. So this let’s you find inside the find results, which may be helpful if what you searched for brought back more results that you hoped for ::smiles:: I think that warrants a video trick upon itself.

http://scottcate.looplogic.com/vstricks079

#78 Customize Find in files, Location and Search Type

With the Find in Files window showing, you can change the Look In: combo box to anything except for open docs and current docs.  This will enable the Look at these file types: option to select what files to search for.

And for more advanced searching…

There’s an ellipse “…” button next to the Look In: combo box. Pressing this will pop up the Choose Search Folders.  Here you can create a set of folders to search in. And now you can find your custom folder set as a Look in: option. Watch the video – it’s much easier to understand 🙂

http://scottcate.looplogic.com/vstricks078

#77 Use Visual Studio to Find in Files – Any disk location

And yet another way of searching code (or any text really) in Visual Studio… it’s called Find in Files.  It is the most comprehensive way to do a search. Even if you’re not looking for code, this can search any text string, in any set of files. We’re not talking about files linked in a project or solution, this is a disk search, say searching a directory and all child directories (or a group of directories).

Press [CTRL]+[SHIFT]+[F] to bring up Find in Files (or check the key bindings for Edit.FindInFiles).  Additionally, you can type in text in the search combo box (located on the standard toolbar, also known as the [CTRL]+[D] window) and press the Find in Files button to the right, as shown below.

http://scottcate.looplogic.com/vstricks077

#76 Dock the Find and Replace window

The Find and Replace window is not a dialog, but actually a tool window.  Thus you can dock it to the side if you find it in your way. Right-click on the tool window Titlebar and select Dockable.  Now the tool window can be docked using a docking target.  Additionally, you can go to Window menu and select Dockable. And finally in VS2010 – it’s drag-and-drop from the title bar or tab name, depending on the current window / dialog state.

http://scottcate.looplogic.com/vstricks076b

#75 Use wildcards and regular expressions while searching

Did you know that you can search in Visual Studio using wildcards and regular expressions (in addition to the regular text search) right from the Find and Replace window? This short tip/trick video shows you how.

Expand the Find options, and check Use:  This will enable you to select either wildcards or regular expressions. With out this selected, the expression builder is disabled. Now, that little grayed-out arrow, called an expression builder, next to the Find what: text box is enabled. Depending on if you chose the Wildcards or RegEx option, the expression builder is a nice little reminder of the search symbols that can be used.

http://scottcate.looplogic.com/vstricks075