从PyCharm搜索中排除带有模式的文件名 [英] Exclude file names with pattern from PyCharm search
问题描述
我有大量自动生成的代码文件,这些文件可以通过文件名中带有_pb2来识别.
I have a large number of auto generated code files that are identifiable by the having _pb2 in the file name.
当我使用PyCharm CTRL + Shift + F 搜索时,可以使用文件掩码.例如,我想查找名称中没有 _pb2
的所有Python文件 *.py
.有办法实现吗?
When I search using PyCharm CTRL+Shift+F I can use a file mask. I would like for instance to find all Python files *.py
that do not have _pb2
in their name. Is there a way to achieve that?
推荐答案
您可以通过创建使用文件名通配符组合进行过滤的自定义范围来包含和排除文件和目录.
You can include and exclude files and directories by creating a Custom Scope that filters using a combination of filename wildcards.
-
Ctrl + Shift + F 打开在路径中查找" .
按照屏幕快照中的步骤2-4创建新的自定义范围.
Create a new Custom Scope following steps 2-4 in the screenshot.
-
输入模式,对于您的规范,它将为
file [Project_Name]:*.py& !! file:* _ pb2 *
之后,搜索结果将被限制在自定义范围"之内.
Afterwards the search results are restricted to within the Custom Scope.
JetBrains官方网站上的来源: "范围配置控制"
Source at JetBrains official site: "Scope configuration controls"
这篇关于从PyCharm搜索中排除带有模式的文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!