How to quickly open a file in Visual Studio 2012

Visual StudioVisual Studio-2012

Visual Studio Problem Overview


I am trying VS2012 RC but find one good feature no available any more (or if it still is, please let me know): in VS2010, if I know a file name, for example, MyFile.cs, I can quickly open it by typing Ctrl+D (or whatever shortcut assigned) to go to Find tool, and then type >of myfile.cs, the file will be opened then, and it is even more convenient that this will do an incremental search of the file name. In the whole procedure I don't need to use mouse at all.

The new Quick Launch tool in VS2012 only searches in opened files, which is really not what I want. Does this feature get supported in VS2012? Is so or if some similar way exists, please tell me.

Visual Studio Solutions


Solution 1 - Visual Studio

I use Ctrl+; then filename then enter then enter.

Solution 2 - Visual Studio

Look into the EDIT Menu at Navigate To... Keyboard shortcut is Ctrl+,

Solution 3 - Visual Studio

I wish there is a simple shortcut to just open a file within a solution.

These 3 are close but none of them is perfect.

  1. Ctrl+; has a delay and does not clear your search after you open the file.

  2. Ctrl+, takes too long initially and it shows method names etc, showing a lot of irrelevant results if you just want to open a file.

  3. Using Command Window you have to type open or of, but in some cases this could/might be the fastest.

    Hit Ctrl+Alt+A to open the Command Window, then type of your_filename

    screenshot of action

Solution 4 - Visual Studio

You can put this back onto the Standard toolbar as follows.

  • Right click the toolbar and select Customize
  • Go to the Commands Tab
  • Select the Toolbar radio button
  • Then select Standard from the combo box
  • Select the Add Command button
  • Select Edit from the Categories list
  • Then find and select "Go To Find Combo" from the Commands list and press OK
  • Move it to where you want it to appear in the toolbar and press Close to save it.

Done!

//*Ergin

Solution 5 - Visual Studio

Actually, there are many methods for switching to files without touching the mouse.

Ctrl + , and type a file name: Switches to the selected file (I think this is what you need)

Ctrl + -: Switches to the previously opened file
Ctrl + Shift + -: Does the same in reverse order

Ctrl + Tab: Again switches to previous file
Ctrl + Shift + Tab: Does the same in reverse order

Hold Ctrl and press Tab multiple times: Switches to selected file
Hold Ctrl, press Tab and release Tab, then select file with Arrow keys: Switches to selected file

Update:
Here is the solution for newer versions of Visual Studio (2017, 2019)

Solution 6 - Visual Studio

Since I don't care for any of these approaches for just locating files, I use the VSFileNav extension in VS 2012. If you know the filename, or part of it, it is much quicker than most of the other approaches, especially for large solutions. I mostly only use the Solution Explorer search for instances where I remember an object name but not the filename.

Solution 7 - Visual Studio

Try using the "code" command to open saved/new files quickly in VS.

For Mac Users Press command+shift+p, a search bar will open at the top in VS

Search for code, "Install code command in PATH" will prompt Press enter.

**Now can open any file or new file with code filename or code -r filename

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionteteView Question on Stackoverflow
Solution 1 - Visual StudioAndrew ClearView Answer on Stackoverflow
Solution 2 - Visual StudiogfdxView Answer on Stackoverflow
Solution 3 - Visual StudioAximiliView Answer on Stackoverflow
Solution 4 - Visual StudioeggboxView Answer on Stackoverflow
Solution 5 - Visual StudioJust ShadowView Answer on Stackoverflow
Solution 6 - Visual StudioNatPriView Answer on Stackoverflow
Solution 7 - Visual StudioAbhinay GuptaView Answer on Stackoverflow