如何从PhpStorm全局搜索中排除文件(Ctrl + Shift + F) [英] How to exclude file from PhpStorm global search (Ctrl+Shift+F)
问题描述
我想从PhpStorm全局搜索(Ctrl + Shift + F)中排除文件,但不从项目本身中排除文件.一个很好的用例是避免在jQuery.js之类的文件中进行搜索,但是在我的特定情况下,我有一个生成代码的插件,它会使搜索结果混乱.
I want to exclude a file from the PhpStorm global search (Ctrl+Shift+F) but not exclude the file from the project itself. A good use case would be to avoid searching inside files like jQuery.js, but in my particular case, I have a plugin that generates code and it clutters my search results.
具体来说,这是示例搜索结果:
Being specific, this is the example search result:
第一个结果是uselss,将永远适合我.因此,我想将其从结果中排除.但是,如果我将其从项目中排除,则它将不会包含在PhpStorm的自动完成功能中,这首先是该文件的唯一目的.
The first result is uselss and will always be for me. So I would like to exclude it from the results. However, if I exclude it from the project then it will not be included in the auto-complete features of PhpStorm, which is the sole purpose of that file in the first place.
或者对此有其他选择吗?我可以选择一个文件夹并仅在其中搜索,但是它不如直接从编辑器中按Ctrl + Shift + F那样方便
Or are there any alternatives to this? I could select a folder and search only there, but it is not as convenient as just pressing Ctrl+Shift+F directly from the editor
推荐答案
您可以定义首先,您必须定义一个范围,该范围包含要可搜索"的项目的所有目录.
First of all you have to define a scope containing all the directories of your project that you want to be "searchable".
转到Appereance & Behaviour -> Scopes
并创建范围
然后,在查找路径"窗口中,可以选择要用于搜索的自定义范围
Then, in the "Find in Path" window you can select the Custom scope you want to use for the search
这篇关于如何从PhpStorm全局搜索中排除文件(Ctrl + Shift + F)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!