Reputation: 13712
In visual studio, we can open a file in a #Include statement by right clicking the filename in include statement and then clicking "Open Document". But sometimes, when I want to open a file, I don't remember where it was in the project or where has it been included. What I do is that I open any file, add a #include statement for that file, then right-click->Open Document to open the file and then remove the #include statement that I added just to open this file.
Can someone plz tell me a more straight forward way of quickly opening a file without searching for it?
I am using Visual Studio 2008
Upvotes: 4
Views: 1075
Reputation: 1405
Visual Assist X's "Open File in Solution" (command VAssistX.OpenFileInSolutionDialog) works great for quickly opening a file. I find it faster to use than Visual Studio's ">of" command.
See http://www.wholetomato.com/products/featureSearch.asp for a screenshot.
Upvotes: 1
Reputation: 29494
Hit Ctrl+/ to go to the "Find" combo box in the default toolbar, type >of Foo.cpp
, and hit enter. of
is the "open file" command and will give you autocompletion with the files in your solution.
This also works for any other system or library header files you include (e.g. windows.h
).
The leading >
character tells the "Find" combo box to act like the Command Window, so any commands that work in the Command Window work in the combo box as well.
Upvotes: 5