Sublime Forum

Sublime Project exclude folder/file.c but not folder/file.cpp

#1

Suppose that I have a project structure like this:
root_folder
|
± folder
|
± file.c
|
± file.cpp

If I want to exclude folder/file.c but keep folder/file.cpp. How to write .sublime-project file?
If I write like this:
{
“folders”:
[
{
“path”: “root_folder”,
“folder_exclude_patterns”:
[
“folder/file.c”
]
}
]
}
file.cpp will also be excluded. So how to write sublime-project file?

0 Likes

#2

You can use file_exclude_patterns instead of folder_exclude_patterns to exclude files; so you could do something like the following (replace *.c with file.c if you literally want to exclude only a single file).

{
   "folders":[
      {
         "path":"root_folder",
         "file_exclude_patterns":[
            "*.c"
         ]
      }
   ]
}
0 Likes