如果您转到“首选项”菜单,然后选择“设置”,它将打开一个包含所有设置及其默认值的 JSON 文件。该文件还用作设置含义的文档。其中两个在这里是相关的。这是 JSON 文件中的 sn-p;
// folder_exclude_patterns and file_exclude_patterns control which files
// are listed in folders on the side bar. These can also be set on a per-
// project basis.
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS"],
"file_exclude_patterns": ["*.pyc", "*.pyo", "*.exe", "*.dll", "*.obj","*.o", "*.a", "*.lib", "*.so", "*.dylib", "*.ncb", "*.sdf", "*.suo", "*.pdb", "*.idb", ".DS_Store", "*.class", "*.psd", "*.db", "*.sublime-workspace"],
// These files will still show up in the side bar, but won't be included in
// Goto Anything or Find in Files
"binary_file_patterns": ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"],
这里说folder_exclude_patterns 将其从侧边栏中隐藏,而binary_file_patterns 将其从搜索中隐藏。所以如果你想从两者中排除它,你可以打开用户设置文件(它会覆盖默认设置)并添加;
{
"folder_exclude_patterns": ["node_modules"],
"binary_file_patterns": ["*/node_modules/*"]
}
请注意,两者是不同的,因为前者是文件夹模式,而后者是文件模式。