How to search for file names in Visual Studio?
Asked Answered
D

23

325

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?

Disobedience answered 2/10, 2009 at 11:26 Comment(3)
possible duplicate of Is there a way to quickly find files in Visual Studio 2010?Zhao
ps, i know this question was asked earlier, but the better, more correct answer is in the linked file.Zhao
No offense, but this feels horrible after CTRL+p of sublime text.Restitution
A
679

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.

Animality answered 10/9, 2013 at 21:9 Comment(20)
How is this not the number 1 answer?Sodalite
@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.Boucher
Well it's not 2009 anymore but people are still coming to this question to get answers, so the updated answer makes sense. :)Animality
I probably waste 30 minutes every day just looking for the correct file in the Solution Explorer. This is my new favorite shortcut!Piedadpiedmont
This shows method names as well though, bit annoying.Belvia
This is so weird that it automatically opens the file while I'm typing the name, causing me accidentally change the file.Ailin
@Ailin I have not had that happen.Animality
Unfortunately that doesn't limit the search to filenames, it also includes symbolsDress
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.Ellanellard
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 thatGanesa
@Belvia 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.Aviate
250 people must have small enough projects that searching through symbols mixed up with files isn't a problem. This answer is not ideal.Bigener
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.Diablerie
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 🤣Ferree
What if this doesn't work? That shortcut does bring up the small panel to type in but it doesn't actually do anything.Rama
This gives me the options window in VS2019.Ralleigh
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!!!Accusation
this doesnt work for visual studio code - Ctrl+, opens setting. I just saw you can Ctrl+Shft+FDahle
CTRL + comma is good to search IN files contents and names. CTRL + T wins for searching in filenames.Tieratierce
if(from Google || from elsewhere) is always true 🤣Deadandalive
O
75

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:

Oleander answered 9/5, 2014 at 4:35 Comment(1)
Great and useful. I am using VS 2019 preview and it works perfectly fine for me.Anergy
D
61

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.

Decoupage answered 21/3, 2012 at 23:2 Comment(1)
Built in to 2017!Leanoraleant
A
51

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 + ,

Arriola answered 28/11, 2017 at 12:10 Comment(5)
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.Tegular
You can even add a custom keyboard shortcut in Tools -> Options -> Keyboard -> Edit.GoToFile which adds the f for you.Tegular
The default for Edit.GoToFile is Ctrl+1, Ctrl+F. There are more with Ctrl+1, Ctrl+<key>. F=Files, M=Members, R=Recent Files, T=TypesDiablerie
Link in answer is dead - domain is for sale.Pianissimo
Thanks for naming the action, something everybody else forgets about. Some people want to learn how to remap it.Aristarchus
T
29

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

Tieratierce answered 8/2, 2019 at 5:40 Comment(1)
This is super useful! Thanks for sharing.Flapjack
C
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.

Creator answered 2/10, 2009 at 12:3 Comment(0)
G
9

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.

Garlicky answered 18/3, 2018 at 9:38 Comment(0)
A
7

I believe what you are searching for is this Ctrl+T. With this you can search for symbols inside files and also can search files if you remove the hash(#) symbol.

See the screenshot if having doubts. Search Shortcut on Windows for VS Code

Australian answered 7/11, 2022 at 10:40 Comment(1)
This answer is regarding Visual Code, not Visual Studio.Leucotomy
P
6

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.

Protoplasm answered 2/10, 2009 at 12:4 Comment(1)
@Andomar: Yes, it depends on whether you have the Visual Studio or IDEA shortcuts configured.Protoplasm
S
4

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.

Southern answered 2/10, 2009 at 11:41 Comment(3)
interesting, does it conflict with resharper do you know?Disobedience
Works for me, but resharper got file search ctrl-shift-tSouthern
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.Body
B
3

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.

Badger answered 3/10, 2009 at 0:48 Comment(1)
nifty solution is excellent. Its simple and it works. It also adds "toggle between header/source" which I like.Quemoy
R
3

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.

Revoice answered 28/1, 2014 at 4:37 Comment(0)
U
3

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

Unlike answered 3/5, 2019 at 6:43 Comment(0)
B
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.

Belew answered 15/1, 2014 at 12:2 Comment(0)
S
2

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

Or, go to Tools and then click Navigate To

Subsidence answered 28/10, 2015 at 10:6 Comment(1)
On visual studio 2012 it is ->EDIT ->Navigate To or ctrl+,Sumy
A
2

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

Arnett answered 19/2, 2019 at 20:41 Comment(1)
Not true for Visual Studio, only vs code. This actually opens the print dialog.Devinna
B
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.

Bakerman answered 21/4, 2020 at 4:30 Comment(0)
S
1

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

Sotted answered 15/3, 2019 at 16:40 Comment(0)
C
1

In VS 2022 -- Couple of ways

  1. As per screenshot 1 <Ctrl + Shift + T> , But that doesnt work with that key combination, although it works with mouse click. Screenshot 1

  2. As per screenshot 2 go to menu Edit -> Go To - > Go To File <Alt + E + G + F>

Screenshot 2

Cointon answered 4/11, 2022 at 18:34 Comment(0)
K
0

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

Kaden answered 19/3, 2012 at 19:11 Comment(4)
Add an index and that's a killer solution!Beer
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.Oleander
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 usefulMcdaniel
b/c I love bouncing between Windows Explorer and Vs.NEt , yeah right.Atcliffe
S
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 :-) )

Stover answered 11/2, 2014 at 4:53 Comment(0)
P
0

Visual Studio 2019:

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

Pricket answered 22/1, 2020 at 9:48 Comment(0)
F
0

I don't know Eclipse, however in Visual Studio 2022 you can use CTRL + T

Fluxmeter answered 11/4 at 9:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.