共用方式為


Quick way to open files in Visual Studio IDE

In 7.0 and later you can simply and quickly open files by going to the Find combo in the toolbar, and type

>open c:\goo\bar.cpp

The pathname will even auto-complete as you type! Even the command name (“open“ in this case) will auto-complete. You will probably find other handy commands in there by experimenting.

Comments

  • Anonymous
    March 03, 2004
    I suppose you are referring to the Command Window? Because in my 7.0, nothing happens when I type that phrase in the Find combo.

    Regards,

    Dennis
  • Anonymous
    March 03, 2004
    Dennis, make sure you typed in the > before open.
  • Anonymous
    March 03, 2004
    Nice feature!
    Guess i'll use ctrl+D more often now :)
  • Anonymous
    March 03, 2004
    You get an error if the filename contain spaces :(
  • Anonymous
    March 03, 2004
    Thomas, it works fine with VS 2003. Quotes get added automagically.
  • Anonymous
    March 04, 2004
    Thought I generally dont like to recommend old products, VC6 has a simpler version. In the Find edit control, type a filename then press Ctrl-Alt-G to open the file. You don't get auto completion. This is the FileGoTo command if you want to customize the keystroke.
  • Anonymous
    March 04, 2004
    If you're opening a file that is part of the solution, press Ctrl+D, type the filename (no path needed), then press Ctrl+Shift+G. Very handy if you have hundreds of uniquely-named files spread across dozens of folders in the one solution.
  • Anonymous
    March 05, 2004
    Isn't it quicker to simply press Ctrl+O and then type in the filename? Seems like fewer keystrokes to me :)
  • Anonymous
    March 08, 2004
    Wow, John! You're absolutely right! This is the best discovery I ever heard of! :))
  • Anonymous
    April 21, 2004
    The nice thing of Ctrl+Shift+G in VC6 is, that it even works in the text editor if the cursor is above a filename/path (either quoted by "" or by <>).

    Any idea how to get this back in VC.NET?
  • Anonymous
    November 16, 2007
    alternative (if you don't like typing 'open'):
  1. ctrl + d
  2. >of myfile.txt
  • Anonymous
    October 21, 2009
    http://www.stjhimy.com/2009/10/20/playing-around-with-visual-studio-make-things-quickly/ it should help =)

  • Anonymous
    January 24, 2010
    Extensions don't work with the express editions. I use AutoHotKey for this, the script is as follows: ^+t:: SetTitleMatchMode, 2 IfWinActive, Visual C++    Send ^d>of{Space} return ...which translates Ctrl+Shift+T to the sequence Ctrl+D, ">of ". Thanks very much for the ">of " trick, that's new to me!