246

In Eclipse you can search for a file in the project by pressing CTRL-SHIFT-R.

Is there a way to do this in Visual Studio?

Randika Vishman
  • 7,157
  • 3
  • 55
  • 75
Edward Tanguay
  • 176,854
  • 291
  • 683
  • 1,015
  • 5
    possible duplicate of [Is there a way to quickly find files in Visual Studio 2010?](http://stackoverflow.com/questions/2667528/is-there-a-way-to-quickly-find-files-in-visual-studio-2010) – Jason Jul 05 '11 at 17:46
  • ps, i know this question was asked earlier, but the better, more correct answer is in the linked file. – Jason Jul 05 '11 at 17:47
  • 1
    No offense, but this feels horrible after CTRL+p of sublime text. – dud3 May 30 '17 at 17:11

20 Answers20

533

Just for anyone else landing on this page from Google or elsewhere, this answer is probably the best answer out of all of them.

To summarize, simply hit:

CTRL + ,

And then start typing the file name.

Community
  • 1
  • 1
Hanna
  • 8,916
  • 11
  • 50
  • 86
  • How is this not the number 1 answer? – dkroy Jan 08 '14 at 19:53
  • @dkroy: ... because it didn't exist when the question was asked. In 2009, it was really a problem to search for files or classes in VS without additional tools. – Stefan Steinegger Sep 23 '14 at 11:42
  • Well it's not 2009 anymore but people are still coming to this question to get answers, so the updated answer makes sense. :) – Hanna Sep 23 '14 at 16:35
  • 7
    I probably waste 30 minutes every day just looking for the correct file in the Solution Explorer. This is my new favorite shortcut! – Rick Love Dec 15 '15 at 20:21
  • 11
    This shows method names as well though, bit annoying. – marsh Jul 11 '16 at 15:08
  • This is so weird that it automatically opens the file while I'm typing the name, causing me accidentally change the file. – Deqing Sep 12 '16 at 06:18
  • @Deqing I have not had that happen. – Hanna Sep 13 '16 at 19:48
  • 3
    Unfortunately that doesn't limit the search to filenames, it also includes symbols – Xavier Poinas Oct 17 '16 at 15:57
  • 12
    Not sure if this accurately answers the question, this thing searches for symbols as wells (methods etc) which is very annoying in a large project. Furthermore, the same thing could be achieved by `Ctrl+;` which is shortcut for search in solution explorer. – nawfal Nov 18 '16 at 14:33
  • For thoses of you that are using Resharper the Ctrl + , only opens the recent files window. If you happen to use Resharper Ctrl + t will search the entire solution. @Johannes might want to add that – D4rth B4n3 Jul 26 '17 at 12:07
  • 10
    @marsh In VS 2017.3 (and possibly earlier) Ctrl-, behaves like a command window somewhat. If you give it the 'f' command and provide a file name, it will search only files: e.g. "f someFile.cpp". There's also a button that prepends the "f" if you prefer clicking. – Kaganar Aug 16 '17 at 01:51
  • 250 people must have small enough projects that searching through symbols mixed up with files isn't a problem. This answer is not ideal. – Manachi Dec 05 '17 at 23:17
  • 1
    Ctrl+1, Ctrl+F opens the dialog for searching from OPs answer directly with file search. It is equivalent to Press Ctrl+, (or Ctrl+T, Edit.GoToAll) and then typing t. – bugybunny Nov 01 '18 at 13:21
  • 1
    Make sure you have the solution open, lol, or it doesn't work! Took me a few minutes to figure out why it wasn't working – TetraDev Jan 15 '19 at 20:42
  • What if this doesn't work? That shortcut does bring up the small panel to type in but it doesn't actually do anything. – Parrotmaster Jan 13 '20 at 14:09
  • This gives me the options window in VS2019. – Rokit Apr 16 '20 at 19:17
  • The best part about the feature is the smart search. If you want to find filename, SomeReallyLongFileName, you can just type the capitalized letter. "srlfn" Try it!!! – rharrison33 Aug 06 '20 at 23:18
  • this doesnt work for visual studio code - Ctrl+, opens setting. I just saw you can Ctrl+Shft+F – GenDemo Jan 07 '21 at 04:04
59

The best option now is to install Microsoft Visual Studio add on called Productivity Power Tools (VS 2010 version, VS 2013 version).

With this comes "Solution Navigator" (alternative to Solution Explorer, with a lot of benefits).

search solution navigator

BTW, this feature is built-in into Visual Studio 2012.

Legends
  • 16,460
  • 9
  • 75
  • 108
friend
  • 1,899
  • 2
  • 21
  • 28
57

In VS2013 you can click in the solution explorer for this functionality.

The shortcut is:

ctrl + ;

To search only the names of files, and not the contents (especially in C#), uncheck these options:

Vimes
  • 7,886
  • 14
  • 52
  • 83
John
  • 1,610
  • 17
  • 30
40

With Visual Studio 2017, It now comes with a much better version, named “Go To All” and is bound to the keyboard shortcut CTRL + T as well as CTRL +, and includes inline filtering and “fuzzy search”

CTRL + T

CTRL + ,

Sajeetharan
  • 186,121
  • 54
  • 283
  • 331
  • 1
    YES, finally they added a built-in way to filter _only_ by filenames! Type `f`, space, then the filename. Example: `CTRL+T` then `f MyClass`, then ↓ on your keyboard until you get to the matching file. This method is superior to the solution explorer search (which wastes space by showing both filenames and class names) in that it is strictly filenames only. – Nate Cook May 25 '18 at 17:10
  • 1
    You can even add a custom keyboard shortcut in Tools -> Options -> Keyboard -> Edit.GoToFile which adds the `f` for you. – Nate Cook May 25 '18 at 17:24
  • 1
    The default for `Edit.GoToFile` is Ctrl+1, Ctrl+F. There are more with Ctrl+1, Ctrl+. F=Files, M=Members, R=Recent Files, T=Types – bugybunny Nov 01 '18 at 12:30
  • Link in answer is dead - domain is for sale. – Pang Nov 11 '20 at 00:58
15

In the search dropdown on the standard toolbar, you can use the "open file" macro, >of, to find files. Click in said dropdown (or hit Ctrl-D) then start typing (minus the quotes) ">of CoreEdit.cs", and you'll get a dynamic list that narrows as you type.

kirkus
  • 911
  • 5
  • 7
10

Easily hit CTRL+SHIFT+T . This will look in the files' names.

Mwiza
  • 4,494
  • 2
  • 33
  • 30
Bedair
  • 141
  • 1
  • 7
8

In Visual Studio 2017 you can search directly for files with Ctrl+1, Ctrl+F (Keyboard command: Edit.GoToFile).

Alternatively, you can use Ctrl+t or Ctrl+, (the Edit.GoToAll command) and start your search with f.

Kyle
  • 152
  • 1
  • 8
5

I use usysware DPack: http://www.usysware.com/dpack/

Then I just press ALT-U start typing the filename and choose the correct file. DPack also has other nice features.

enter image description here

(highlights added for screenshot)

Note: Will not work in Express editons of Visual Studio, since they don't allow plugins.

Ian Boyd
  • 220,884
  • 228
  • 805
  • 1,125
Erwin
  • 664
  • 5
  • 12
  • interesting, does it conflict with resharper do you know? – Edward Tanguay Oct 02 '09 at 11:53
  • 4
    Works for me, but resharper got file search ctrl-shift-t – Erwin Oct 02 '09 at 12:02
  • i already use DPack (Delphi Pack) for their brief bookmarks. i didn't realize they also had unit search. Sad that Delphi's 10 year old IDE is more developer friendly than Visual Studio. People don't *realize* what they're missing; how sloppy VS is. – Ian Boyd Nov 07 '11 at 18:59
4

Since you mention ReSharper in a comment:

You can do this in ReSharper by using the "Goto File..." option (Ctrl-Shift-N or ReSharper -> Go To -> File...) in my key mappings.

adrianbanks
  • 76,725
  • 21
  • 166
  • 198
2

Visual Assist: link.

Install, load solution, press Shift+Alt+O, search for files in solution by substring. Try also Shift+Alt+S, for the equivalent for symbols. This addin has a bunch of completion popup and syntax colouring stuff in it that aren't to all tastes, but the code browsing features are done well and seem uncontroversial.

Judging by comments on the forums, compatibility with Resharper is something they pay attention to.

For free, try also Nifty Solution: link.

I haven't used this myself, but I use the author's Nifty Perforce plugin, and that is pretty tidy.

jezrael
  • 629,482
  • 62
  • 918
  • 895
  • nifty solution is excellent. Its simple and it works. It also adds "toggle between header/source" which I like. – javs Jun 20 '11 at 15:03
2

Open command window( View -> Other windows -> command window - Ctrl + W, A) type >of followed by the file name. It would start showing up the list as you type.

user2645830
  • 352
  • 1
  • 5
  • 21
2

I'd recommend PhatStudio if you're using upto VS 2012. Works pretty fast, and supports multi-word search by using "space". So to search for LoginController, you could press Alt+O and search using "Lo Con".

enter image description here

You could also use ReSharper (paid) and CodeMaid (free) to do this.

Pang
  • 8,605
  • 144
  • 77
  • 113
arviman
  • 4,587
  • 37
  • 44
2

CTRL + P this searches for the file name your direct answer.

Mwiza
  • 4,494
  • 2
  • 33
  • 30
Juke
  • 972
  • 2
  • 7
  • 20
2

Visual Studio for Mac 2017 7.x.x

To search by File name:

  • + .
  • Ctrl + Shift + D

To search by Type name:

  • Ctrl + Shift + T

Your keyboard focus might have been gone to following Right side Top corner of the Visual Studio Window:

enter image description here

Community
  • 1
  • 1
Randika Vishman
  • 7,157
  • 3
  • 55
  • 75
2

You can press ctrl+t to get a editor Get to all , in which you can type the file name to navigate to that specific file.

1

You can easily call for a window called "Navigate To" with combination ctrl + ,

Or, go to Tools and then click Navigate To

Eduardo A
  • 311
  • 3
  • 3
1

Is too simple by using the Windows Explorer search inside the project folder. Done.

Carloss
  • 35
  • 1
  • Add an index and that's a killer solution! – Martin Capodici Dec 20 '12 at 23:53
  • This option wouldn't work for ftp sites loaded in visual studio. In vs2013 Ctrl + semi colon allows you to search the solution explorer quickly by filename without leaving the window. – John May 09 '14 at 04:20
  • I am using VS 2010 and I wanted to open all the code behind files of my User Controls (i.e `.ascx.cs` files). Really your solution is straight forward and useful – sohaiby Jul 25 '15 at 08:33
  • 2
    b/c I love bouncing between Windows Explorer and Vs.NEt , yeah right. – RyBolt Nov 01 '16 at 13:11
0

In Visual Studio 2008 (and probably later), the free DevExpress CodeRush Xpress add-in supplies Ctrl+Alt+F, Quick File Navigation, which searches on an exact substring in the file name or on capital letters.

(Unrelated to this answer, but note the rather more useful, Quick Navigation, Ctrl+Shift+Q, which I would have liked to have known about before now :-) )

Mark Hurd
  • 10,175
  • 10
  • 62
  • 96
0

With Visual Studio 2017 Community edition on mac, the shortcut is:

  • Cmd+Shift+D: Find by file name
  • Cmd+Shift+T: Find by type name

To see these commands, navigate to the top menu: Search > Go To

Mwiza
  • 4,494
  • 2
  • 33
  • 30
Kes115
  • 1,652
  • 1
  • 16
  • 35
0

Visual Studio 2019:

Menu -> Preferences -> Key Bindings -> Navigate To...

Oz Shabat
  • 912
  • 10
  • 11