Sublime Forum

How to exempt folder_exclude_patterns

#1

In my default preferences, I have configured:

folder_exclude_patterns : ["build"]

That’s there because Python projects commonly produce a build directory as part of their build artifacts and I don’t want that showing up in the tree.

But when I go to work on pypa/build, I find the src/build folder is missing and I can’t work on the project. I find I have to temporarily disable the exclude pattern to work on the project.

Like other users have reported in this forum, I’d like for there to be a way to exclude build from the root of projects but not from elsewhere in the tree, or to on a per-project basis re-introduce a name.

I did try adding

"folder_include_patterns": ["src/build"]

But that wasn’t sufficient to override the exclude.

Another way this need could be met would be for sublimetext to honor .gitignore directives, which allows for restoring ignored files.

0 Likes

#2

Maybe the documentation here with help: https://www.sublimetext.com/docs/file_patterns.html

The path matching goes into a different mode depending on whether you specify only a basename.

0 Likes

#3

I’ll be honest - I was skeptical as I’d searched through past issues and poked through the documentation, but I’d missed the feature for // prefix indicating root of the project. I was able to change the exclude pattern to:

"folder_exclude_patterns": ["//build"]

and if fixed the issue. Now build is only excluded if it’s in the project root. Thanks!

1 Like