Answers:
要从索引中排除文件但将其保留在边栏中,请使用“ binary_file_patterns
用户设置”中的设置,例如:
"binary_file_patterns": [
"*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds",
"*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip",
"node_modules/**",
"bower_components/**"
]
确保从Settings - Default
首选项中复制值(此处显示为"*.jpg"
等),否则您将开始索引二进制文件。
index_exclude_patterns
,例如 "index_exclude_patterns": ["*.log","node_modules/**","bower_components/**"]
"folder_exclude_patterns": ["name_of_folder"]
可能有助于从搜索结果中删除某些模式,但是我尚未对其进行测试。来源:coderwall.com/p/bk90bw/...
index_exclude_patterns
没有隐藏node_modules
,从‘转到任何东西’(⌘P)的文件中搜索: "index_exclude_patterns": ["*.log", "node_modules/**"],
与崇高文本3.1.1,构建3176.测试
您可以在中更改您的个人设置Preferences -> Settings - User
,添加:
{
"folder_exclude_patterns":
[
".svn", ".git", ".hg", "CVS",
"node_modules",
],
}
"folder_exclude_patterns": ["build/**", ".gradle", "node_modules/**"],
在ST3(内部版本3126)中不起作用。
您可以在边栏中显示节点模块文件夹,并在其中隐藏文件:
"file_exclude_patterns":
[
...,
"node_modules/**"
]
如果要隐藏每个节点模块的子文件夹:
"folder_exclude_patterns":
[
"node_modules/*/**"
]
node_modules内部的所有文件将从搜索中删除,但每个node_module子文件夹在侧栏中仍将可见。
Sublime Text 3现在提供了一种将文件和文件夹从索引中排除的方法,同时将它们保留在边栏中:
"index_exclude_patterns": [
"*.log",
"node_modules/*"
]
在我的项目中,应用更改后,我在索引状态菜单中观察到以下改进:
之前:
index "MyApp" collated in 0.70s from 73934 files
index "MyApp" is using 15167488 bytes for 54234 symbols across 1357673 locations
后:
index "MyApp" collated in 0.00s from 137 files
index "MyApp" is using 61440 bytes for 730 symbols across 4763 locations