134

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.

Nate
  • 30,286
  • 23
  • 113
  • 184
tete
  • 4,859
  • 11
  • 50
  • 81

7 Answers7

247

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

Joe
  • 14,039
  • 2
  • 39
  • 49
Andrew Clear
  • 7,910
  • 5
  • 27
  • 35
  • 2
    Thanks -- this is great! I don't have ReSharper installed on 2012 yet but in the meantime I just remapped Window.SolutionExplorerSearch from Ctrl + ; to Ctrl + Shift + T and it has been working nicely! – Ryan Lanciaux Aug 20 '12 at 16:28
  • 10
    This would be perfect if it would clear the selection after opening the file. As it is, having to manually clear it with the mouse makes it nearly useless. :-( I want a sublime text style onebox open file/search symbol/goto line addin for VS. – Chris Hynes Feb 21 '13 at 01:31
  • 6
    @ChrisHynes To clear out selection... you can hit Ctrl + ; again and then hit ESC key, which will clear out the field. If you hit ESC another time, it will put your focus back in the code editor as well. (Not ideal, but better than nothing.) – Jason Parker Jul 29 '13 at 15:38
  • 5
    This is way too slow, it doesn't update the list until you stop typing and wait a couple seconds. It's unusable. I need something like Xcode/Eclipse's functionality, which updates in realtime. – Glenn Maynard Sep 14 '15 at 15:11
  • 1
    I found its too slow when the project size is two large. In smaller project is returning quickly. – Arundev Mar 30 '16 at 15:43
151

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

Joe
  • 14,039
  • 2
  • 39
  • 49
gfdx
  • 1,759
  • 1
  • 11
  • 9
  • This shortcut (and others) can also be modified in the Tools...Options...Environment...Keyboard menu if you want to match it to other IDEs. – Robert Zahm May 09 '13 at 14:15
  • [NavigateToAll](https://visualstudiogallery.msdn.microsoft.com/bdbc361a-ee69-4ba3-83ff-ab2e8122ff47) makes Navigate To even better by allowing you to open _any_ file, not just the ones in the solution. I found this especially useful for large projects. – tcb Oct 11 '14 at 03:52
  • Can we edit all shortkey to same resharper shortkey? – Hien Nguyen Mar 20 '19 at 02:41
82

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

Aximili
  • 28,626
  • 56
  • 157
  • 216
22

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

leetNightshade
  • 2,673
  • 2
  • 36
  • 47
eggbox
  • 617
  • 4
  • 16
  • 3
    This solution is exactly what I was looking for, since it emulates the behavior in previous versions of Visual Studio. However, this answer was a little confusing for me to read, so I submitted an edited version for peer review, to make it a little more readable for others. – leetNightshade Dec 06 '12 at 21:57
  • 1
    At least in vs2015 this "find combo" in my toolbar did NOT allow me to open files by name. It behaved exquivalent to a find-in-document except pressing enter doesnt even find next, I had to use F3. – James Feb 25 '17 at 22:56
  • ctrl + shift + t does the same – Gunay Orbay Jan 17 '20 at 18:14
14

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)

Just Shadow
  • 10,860
  • 6
  • 57
  • 75
7

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.

NatPri
  • 81
  • 1
  • 3
  • 2
    Despite the lack of upvotes, I've found this (the VSFileNav extension) to be the best solution currently on this page, having tried them all. (+1) – Jon Schneider Oct 26 '15 at 13:45
0

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

Abhinay Gupta
  • 191
  • 2
  • 4