Visual Studio trick to quickly find any file in solution

Published 02 August 08 08:04 PM | andarno 

You know that Find text box in the toolbar of Visual Studio?  Those of us who are keyboard-inclined probably never use it because Ctrl+F is quicker than moving your hand to the mouse.  But there is a hidden gem of a feature inside it that really makes me feel like a power user that I wanted to share.

That find box doubles as a Command Window prompt if you just start with a '>' sign.  The feature in this that I use the most is this:

image

First jump up to that box using the keystroke Ctrl+/.  Now type ">of " and follow with the start of a filename.  As fast as you can type, Visual Studio searches your entire solution for a file or path that starts with the characters you type and you can quickly select that file (with the keyboard using the arrow keys if you wish) and open it.  If you're working in a solution with several projects or folders, this can be a significant time saver.

For those of you unfamiliar with the Command Window, you can think of it like an Immediate Window that you use with the debugger, except that instead of controlling the debuggee, you're controlling Visual Studio.  It's like the VS macro editor, except that everything you type takes immediate effect.  To have this conveniently just a Ctrl+/, > keystroke away, especially when ">of " (short for Open File) is such a convenient acronym to search across your entire solution is awesome.

Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# JamesCurran said on August 4, 2008 10:24 AM:

>> Those of us .... probably never use it because ....

Actually we don't use it because, as of Vs2005, Case Sensitivity & Whole-Word don't have toolbar icons any more --- and, what really did it in --- as of vs2008, Find Prev & Find Next don't have toolbar icons either.  So what the point of have a toolbar box for one step of the process, when to do anything with it, you'd have to use the menus or keyboard anyway.

# Tian van Heerden said on May 13, 2009 8:33 AM:

First, an aside: it's worth noting that Ctrl+F and Ctrl+Shift+F remember their settings separately, so I always use Ctrl+F for searching within the current file, and Ctrl+Shift+F for searching the entire project.

That said, to find files by name and have all the benefits of the standard VS search (next/prev match, show results in "find results window", etc) as follows:

- use Ctrl+Shift+F to bring up dialog

- for search term enter just an asterisk: *

- under Find Options select Use: Wildcards

- under "Look at these file types" enter your search term, DOS-style wildcards are supported, e.g. menu* to find all files starting with "menu"

Voila!

# Fred Gohsman said on October 2, 2009 10:05 AM:

I have not seen the search combo box on the toolbar since VS.NET.  How do I get it back?

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required

Search

This Blog

Interesting blogs

Related sites

Syndication

Page view tracker