可通过项目或全局设置隐藏Sublime Text侧边栏文件。在项目配置中添加"folder_exclude_patterns"和"file_exclude_patterns"可过滤指定文件夹和文件,如.git、node_modules及.log等;2. 全局设置需在Preferences→Settings中修改用户配置,同样使用上述字段实现所有项目的默认隐藏;3. 支持通配符,路径相对项目根目录,保存后即时生效。

Sublime Text 可以通过项目设置或全局设置来隐藏侧边栏中不需要的文件或文件夹。以下是具体操作方法。
1. 使用项目设置隐藏特定文件(推荐)
如果你使用的是 Sublime Text 项目,可以直接在项目配置中过滤不想显示的文件。
步骤如下:
- 打开菜单栏:Project → Edit Project
- 在弹出的项目配置文件中添加 "folder_exclude_patterns" 和 "file_exclude_patterns" 字段
示例配置:
{
"folders": [
{
"path": ".",
"folder_exclude_patterns": [".git", "node_modules", "__pycache__", "dist"],
"file_exclude_patterns": ["*.log", "*.tmp", "*.swp", "*.DS_Store"]
}
]
}
保存后,指定的文件夹和文件就会从侧边栏中隐藏。
2. 修改用户全局设置隐藏文件
如果不使用项目,也可以修改全局设置来实现默认隐藏。
- 点击菜单:Preferences → Settings
- 在右侧用户设置中添加以下内容:
{
"folder_exclude_patterns": [".git", "node_modules", "__pycache__"],
"file_exclude_patterns": ["*.log", "*.tmp", "*.DS_Store", "*.sublime-project"]
}
这样所有打开的项目都会默认隐藏这些条目。
3. 过滤规则说明
- folder_exclude_patterns:用于屏蔽整个文件夹
- file_exclude_patterns:用于屏蔽匹配的文件
- 支持通配符 *,例如 *.min.js 或 temp_*
- 路径是相对于项目根目录的
基本上就这些,设置完后侧边栏会立即刷新显示效果。










