Sublime Text 3 - 在左窗格中隐藏不需要的文件夹
Sublime Text 3 - hide unwanted folders in left pane
所以我在 Sublime Text 3 中打开了一个文件夹。
此文件夹包含如下结构:
src
build // I would like to hide this folder
.sass-cache // and this folder
node_modules // and this folder
task
test
在左侧(边栏)的文件夹窗格中,我得到了上述文件夹。我想从视图中隐藏其中的一些,只看到剩余的文件夹。
有没有办法使用启动时加载的列表或其他文件来实现文件夹隐藏?
我在考虑类似 .gitignore 文件之类的东西,它只是列出文件夹或模式以隐藏内容。
您需要在首选项中设置"folder_exclude_patterns"
and/or "file_exclude_patterns"
。默认值如下:
"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"]
SelectPreferences -> Settings—User
,然后添加以下行:
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules", ".sass-cache", "build"]
如果您在项目中工作,select Project -> Edit Project
,并将上面的行添加到 "settings"
字典中。在这两种情况下,请确保文件有效 JSON.
作为参考,这里有一个最小工作示例 项目文件 排除文件和文件夹:
{
"folders":
[
{
"path": ".",
"file_exclude_patterns": ["*.sublime-project", "*.sublime-workspace"],
"folder_exclude_patterns": [".idea", "__pycache__"]
}
]
}
所以我在 Sublime Text 3 中打开了一个文件夹。
此文件夹包含如下结构:
src
build // I would like to hide this folder
.sass-cache // and this folder
node_modules // and this folder
task
test
在左侧(边栏)的文件夹窗格中,我得到了上述文件夹。我想从视图中隐藏其中的一些,只看到剩余的文件夹。
有没有办法使用启动时加载的列表或其他文件来实现文件夹隐藏?
我在考虑类似 .gitignore 文件之类的东西,它只是列出文件夹或模式以隐藏内容。
您需要在首选项中设置"folder_exclude_patterns"
and/or "file_exclude_patterns"
。默认值如下:
"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"]
SelectPreferences -> Settings—User
,然后添加以下行:
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules", ".sass-cache", "build"]
如果您在项目中工作,select Project -> Edit Project
,并将上面的行添加到 "settings"
字典中。在这两种情况下,请确保文件有效 JSON.
作为参考,这里有一个最小工作示例 项目文件 排除文件和文件夹:
{
"folders":
[
{
"path": ".",
"file_exclude_patterns": ["*.sublime-project", "*.sublime-workspace"],
"folder_exclude_patterns": [".idea", "__pycache__"]
}
]
}