August 2nd, 2008

Visual Studio trick to quickly find any file in solution

Andrew Arnott
Principal Software Engineer

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.

Author

Andrew Arnott
Principal Software Engineer

Principal Software Engineer and OSS contributor. Visual Studio Platform.

0 comments

Discussion are closed.