我习惯了Resharper,在那里我可以搜索文件,不是内容,而是文件名,这使得它可以快速打开新文件。

这个功能在Visual Studio Code中实现了吗?有快捷方式吗?


当前回答

假设你在vs code中有上千个文件,你想要搜索一个具有特定名称的文件

右击VS代码编辑器。 选择命令面板 在文本框中输入文件名

其他回答

我使用的是VSCode 1.12.1

OSX press :

Cmd

+

p

在OSX上,对我来说,它是cmd⌘+ p. cmd⌘+ e只是在当前打开的文件中搜索。

我最终安装了扩展文件名称搜索。它在侧导航栏中显示与名称部分匹配的所有文件,因此我可以逐个打开它们来检查或处理它们。

Ctrl + p:我们必须对每个文件重复搜索 的Ctrl + f 资源管理器:它不搜索,它只是过滤文件在扩展 文件夹

下面是一个在资源管理器中搜索,然后在文件名搜索扩展名中搜索的演示:

其他答案没有提到这个命令名为workbench.action.quickOpen。

您可以使用它来搜索位于首选项中的键盘快捷键菜单。

在MacOS上,默认的键盘绑定是cmd⌘+ P。

(来自Sublime Text,我总是将此更改为cmd⌘+ T)

在VSCode 1.75(2023年1月)中,你将有一个新的文件过滤器选项:“模糊匹配”切换。

来自问题116286:树:支持连续查找

In a list of files I can filter them by start typing the name of the file. It is a super useful feature when you have hundreds+ files. My issue is that the filter is trying to find the letters in the whole file name. Here is an example search for word "file": this-is-**file**-i-looked-for.jpeg (I expect this to be returned) **f**or-th**i**s-**l**.jp**e**g (This should not be returned, it is only a random match) Would it be possible to add there extra settings to only returns full strings matches? Or is there some setting already buried somewhere?

解决方案:在树查找小部件中添加一个“模糊匹配”切换按钮。

新选项:

defaultFindMatchTypeSettingKey。fuzzy:搜索时使用模糊匹配。 defaultFindMatchTypeSettingKey。在搜索时使用连续匹配。