Frustrated by the current options for getting .gitignore
'd files excluded from Fuzzy Find (which I am used to from out-of-the-box Atom and VS Code), I thought about creating a plugin that syncs .gitignore
to either folder_exclude_patterns
/ folder_include_patterns
or binary_file_patterns
- similar to sublime-gitignorer, but per project.
However, I noticed that .gitignore definitions cannot be losslessly mapped to these settings in all cases! For instance, in .gitignore
, it is possible to exclude a folder, but make an exception for a specific subfolder:
node_modules
!node_modules/foo
However, the Sublime Text system seems to work the opposite way: include patterns are applied first (excluding non-matching folders) and exclude patterns only further narrow down the set of included patterns. binary_file_patterns
doesn’t have an “exceptions” mechanism at all.
Another problem is absolute patterns:
/node_modules
In .gitignore
, this means “exclude the node_modules
folder directly in the project root”, whereas Sublime Text would interpret this pattern as “exclude the node_modules
folder in the file system root”. This is not a problem in itself; however, what is a problem that there is no Sublime equivalent for the above .gitignore
pattern. I assume this is because project folder patterns are just appended to the global patterns and treated the same way?
So, in summary, I would love to see the Sublime Text include/exclude pattern system extended so that a full-featured .gitignore
plugin is possible. This means:
- Support for exclude exception patterns
- Support for project-root-relative exclude patterns (something like
./node_modules
could be a possible syntax)
Even better, of course, would be if Sublime Text natively supported exclusion of .gitignore
'd files from fuzzy find and/or the sidebar. One can still dream.