I know that a file exclude pattern can be set in Sublime Text's project/default settings, but is it also possible to only include files based on a pattern?
For example, when working with my C++ projects, I tend to have files in the same folder that are not necessarily source files.
Can I explicitly tell Sublime Text to show me only *.cpp, *.h, and *.txt files while ignoring everything else?
A pattern is a string or list of newline-delimited strings. File and directory names are compared to patterns to include (or sometimes exclude) them in a task. You can build up complex behavior by stacking multiple patterns.
Since Sublime Text 3 final, a wildcard icon '/*' is used for all files. '/' has an established meaning: all files in a directory.
List the extensions you want included in file_include_patterns
. The following works for me with ST3 project files, don't have ST2 handy to test.
{
"folders":
[
{
"name": "My Project",
"path": ".",
"file_include_patterns": [
"*.cpp",
"*.h"
]
}
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With