Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 2 file include pattern

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?

like image 256
Omar Darwish Avatar asked Oct 23 '13 19:10

Omar Darwish


People also ask

What are file patterns?

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.

What does /* mean in sublime text represent in source code file?

Since Sublime Text 3 final, a wildcard icon '/*' is used for all files. '/' has an established meaning: all files in a directory.


1 Answers

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"
      ]
    }
  ]
}
like image 192
Praetorian Avatar answered Oct 23 '22 23:10

Praetorian