visual-studio 如何在 Visual Studio 中搜索文件名?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1508973/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 11:04:00  来源:igfitidea点击:

How to search for file names in Visual Studio?

visual-studiosearchkeyboard-shortcutsvisual-studio-mac

提问by Edward Tanguay

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

Eclipse 中,您可以通过按CTRL- SHIFT-在项目中搜索文件R

Is there a way to do this in Visual Studio?

有没有办法在Visual Studio 中做到这一点?

回答by Hanna

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

对于从 Google 或其他地方登陆此页面的任何其他人来说,这个答案可能是所有答案中的最佳答案。

To summarize, simply hit:

总而言之,只需点击:

CTRL+ ,

CTRL+ ,

And then start typing the file name.

然后开始输入文件名。

回答by friend

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

现在最好的选择是安装名为 Productivity Power Tools(VS 2010 版VS 2013 版)的Microsoft Visual Studio 插件。

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.

顺便说一句,此功能内置于 Visual Studio 2012 中。

回答by John

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

在 VS2013 中,您可以在解决方案资源管理器中单击此功能。

The shortcut is:

捷径是:

ctrl+ ;

ctrl+ ;

回答by Sajeetharan

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

随着Visual Studio 2017,它现在带有一个更好的版本,命名“Go To All”并绑定到键盘快捷键CTRL + T以及CTRL +,包括内联过滤和“fuzzy search”

CTRL+ T

CTRL+ T

CTRL+ ,

CTRL+ ,

回答by kirkus

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.

在标准工具栏上的搜索下拉菜单中,您可以使用“打开文件”宏 >of 来查找文件。单击所述下拉列表(或按 Ctrl-D),然后开始输入(减去引号)“>of CoreEdit.cs”,您将获得一个动态列表,该列表会随着您的输入而缩小。

回答by Kyle

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

在 Visual Studio 2017 中,您可以使用+ 、+ (键盘命令:Edit.GoToFile)直接搜索文件Ctrl1CtrlF

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

或者,您可以使用Ctrl+tCtrl+ ,(Edit.GoToAll 命令)并使用 开始搜索f

回答by Bedair

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

轻松点击 CTRL+SHIFT+T 。这将查看文件的名称。

回答by Erwin

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

我使用ussysware 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.

然后我只需按 ALT-U 开始输入文件名并选择正确的文件。DPack 还具有其他不错的功能。

enter image description here

在此处输入图片说明

(highlights added for screenshot)

(为截图添加了亮点)

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

注意:不能在 Visual Studio 的 Express 版本中工作,因为它们不允许插件。

回答by adrianbanks

Since you mention ReSharper in a comment:

由于您在评论中提到了 ReSharper:

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

您可以通过在我的键映射中使用“转到文件...”选项(Ctrl-Shift-N 或 ReSharper -> 转到 -> 文件...)在 ReSharper 中执行此操作。

回答by adrianbanks

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.

安装,加载解决方案,按Shift+ Alt+ O,按子字符串搜索解决方案中的文件。也尝试Shift+ Alt+ S,等效于符号。这个插件有一堆补全弹出和语法着色的东西,不是所有的口味,但代码浏览功能做得很好,似乎没有争议。

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

从论坛上的评论来看,与 Resharper 的兼容性是他们关注的。

For free, try also Nifty Solution: link.

也可以免费试用 Nifty 解决方案:链接

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

我自己没用过这个,但我用了作者的 Nifty Perforce 插件,这很整洁。