我习惯了Resharper,在那里我可以搜索文件,不是内容,而是文件名,这使得它可以快速打开新文件。
这个功能在Visual Studio Code中实现了吗?有快捷方式吗?
我习惯了Resharper,在那里我可以搜索文件,不是内容,而是文件名,这使得它可以快速打开新文件。
这个功能在Visual Studio Code中实现了吗?有快捷方式吗?
当前回答
对于windows。 如果Ctrl+p并不总是有效 使用Ctrl+shift+n代替。
其他回答
使用转到文件…在Go菜单下或使用键盘快捷键:
Windows下按Ctrl+p或Ctrl+e 在macOS Cmd⌘+p Linux下按Ctrl+p或Ctrl+e
然后输入文件名。
此外,请确保您可以设置自己的键绑定,并且有适用于Windows、macOS和Linux的备忘单。
使用Ctrl+P(或Cmd+P)的问题是,它搜索您的工作区,而忽略了.gitignore文件中设置的文件和文件夹。要改变这种行为,添加“search”。useIgnoreFiles":设置为false。.vscode目录下的Json文件。
注意搜索。排除和文件。排除设置将覆盖此设置。在你的设置中。如果你想搜索VS Code项目中的所有文件和目录,你应该将它们注释掉,或者将这两个设置设置为false。设置示例。Json在哪里搜索。排除和文件。Exclude被注释掉用于搜索所有文件:
{
"search.exclude": {
//"**/Lib": true,
//"**/Scripts": true
},
"files.exclude": {
//"**/Lib": true,
//"**/Scripts": true
},
"search.useIgnoreFiles": false
}
点击这里获取更多信息。
如果您只想搜索单个文件名
只需按Ctrl+P,然后输入并选择你的一个
如果要打开名称包含特定字符串的所有文件
打开搜索面板 把常用词放进这些文件里 在'files to include'中,将搜索字符串加上*,例如*Signaller*
在OSX上,对我来说,它是cmd⌘+ p. cmd⌘+ e只是在当前打开的文件中搜索。
在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。在搜索时使用连续匹配。