The selectors file_exclude_patterns
and folder_exclude_patterns
seem to only support basic wildcard operations using *
, unlike the regular expressions available in other configurations. The lack of detailed information in the project file documentation further complicates this issue.
In this scenario, you have two main options, each with its own advantages and disadvantages. Neither option requires you to specifically list out the files you want to exclude.
Firstly, many guides overlook the existence of file_include_patterns
and folder_include_patterns
. If your project directory mainly consists of a few file types, you can utilize code similar to the example below to include only css
files within the vendors
directory. The drawback is that you need to explicitly specify what you want to see, rather than what you don't want to see, which can be cumbersome. Using both file_include_patterns
and file_exclude_patterns
simultaneously for a single folder does not work.
"file_include_patterns": [
"vendors/*.css",
"*.less"
]
Alternatively, if you prefer utilizing Goto Anything
and are indifferent to the appearance in the sidebar, you can add the vendors
subfolder as a separate entity in the sublime-project
file and adjust settings per folder accordingly. This approach may result in something like the following:
{
"folders":
[
{
"path": "path/to/dev/public",
"file_exclude_patterns": [
"*.css"
],
"folder_exclude_patterns": [
"vendors"
]
},
{
"path": "path/to/public/vendors"
}
]
}
Both methods may appear complicated and somewhat unconventional—perhaps in the future, we will have the capability to use regular expressions for defining file exclusions.