Quickly Find/Open a File in Visual Studio

Here is a cool Visual Studio feature that almost nobody knows about. If you want to open up a file in your solution, but can’t be bothered to dig down through your projects and folders to find it, try this,

  1. Click in the Find box in the toolbar,
  2. Type >of followed by a space, then begin the name of the file you are looking for.
  3. An auto-complete drop down will appear as you type filtering all the files in all your projects in your solution. Continue typing until the list is short enough to fine the one you want. Select it and hit enter.
  4. The file will open in the editor.

Update: After this post made the front page of DotNetKicks, Aaron Lerch wrote a great post on his blog with more things that you can do with the find combo. One thing that is very useful is that with the >, you can issue any command, the alias >of mentioned here is just one of many. For a list of the commands, check out this MSDN page.

Another useful tip is that Ctrl+D or Ctrl+/ will automatically jump to the find box, so your hands don’t even need to leave your keyboard.

Update: This trick was also mentioned on Just Sayin More Words as a part of his Stupid Visual Studio Trick series. Thanks.

  • Pingback: Visual Studio - tips for managing work on many open files | Technology & Programming()

  • Pingback: Visual Studio – tips for managing work on many open files | Ask & Answers()

  • Josh Noe

    Awesome thanks! Has anyone been able to get “ctrl+/ >of” to work as a macro? I record the macro, but when I run it, the cursor never enters the find textbox.

  • http://www.mrnurullo.ucoz.com/ Nurullo

    if you want to download books for free

  • HappyCoder

    You made me one happy coder. Thanks!

  • http://www.stjhimy.com stJhimy
  • http://entrian.com/blog/ Richie Hindle

    SonicFileFinder is a VS free addin that does this in a more powerful and more accessible way: http://jens-schaller.de/sonictools/sonicfilefinder/index.htm

  • http://allaboutasp.net Ajay

    i am not able to find this shortkey i am using vs 2005 professional edition.
    is there any other way to search files ?

  • http://chacaz.com/users/cgi-bin/pb.cgi?aid=7&cid=11716529&memid=xxxx Viet Heroes

    thanks very useful

  • http://link Caleigh

    Keep a good work man!,

  • http://link Thom

    It’s a very good site !! Very nice work, admin :) Good luck !,

  • http://link Jeremy

    It is healthy, I shall come on your site more often, thank.,

  • Pingback: Captain’s Log » Open a file by name… - Personal Web Log of Tom Lianza()

  • Pingback: Opening files from the VS "Quick find combo" - Wes' Puzzling Blog()

  • http://www.ovalsquare.com Ted Jardine

    Even better is ctrl-shift-n which brings up a very cool look ahead file or class finder. I probably use this shortcut close to 100 times a day. However, I just realised this is actually (I think – will have to double check) Resharper goodness. All the more reason to use Resharper.

  • Jokin

    another post on the same topic.

    this one with the keyboar shortcut:
    ctrl + d or ctrl + /

  • http://www.prouse.org Robert Prouse

    Aaron, no copycatting implied 😉

    We all learn from one another, that is what its all about.

  • http://www.aaronlerch.com/blog/ Aaron

    Thanks Rob!

    And, for the record, so it doesn’t look like I’m just a copycat, I had my post written a week or so ago, but just didn’t get it finished until yesterday, and of course as soon as I posted it I saw yours on dotnetkicks and said “doh!” :)

    Thanks! :)

  • http://vaultofthoughts.net Michal Talaga

    Excelent! Now to find a shortcut that puts a focus inside that find box…

  • http://www.saasu.com Nik Derewianka

    There is also the ctrl-alt-a to open the command window, then type open filename.cs

    You also get an auto-complete drop down list, with history (up and down keys), but no need to use the mouse.

  • Jokin

    good trick, with the keyboard short cut to focus on te search box it will be better.
    you know it?

  • http://blog.hebsgaard.dk Klaus Hebsgaard

    Type CTRL + ‘ to go to the find box, that way you don’t have to use your mouse