Civilian
Civilian

Reputation: 654

Use `folder_exclude_patterns` to only ignore top-level directory

I have a directory structure:

app
--controllers
----components
components

And in my sublime text 2 project file I want to ignore the top-level components directory (which was created by a bower install while keeping access to the components directory in controllers.

How do I do this? Here's my current sublime settings:

{
  "folders":
  [
    {
      "path": "/path/to/Project",
      "folder_exclude_patterns": ["cake", "vendor", "node_modules", "components"],
      "file_exclude_patterns": ["*.sublime-workspace"]
    }
  ]
}

Upvotes: 1

Views: 876

Answers (2)

papo
papo

Reputation: 1989

as of 2020, (build 4067) it's possible to reference project-folder using '//'

"folder_exclude_patterns": ["cake", "vendor", "node_modules", "//components"],

before 2020, you could do:

"folder_exclude_patterns": ["cake", "vendor", "node_modules", "/path/to/Project/components"],

or on Windows - without ':'

"folder_exclude_patterns": ["cake", "vendor", "node_modules", "C/path/to/Project/components"],

Note there is no official release in 2020 yet, only dev.

Upvotes: 3

MattDMo
MattDMo

Reputation: 102902

You can add additional paths to members of the folder_exclude_patterns array:

"folder_exclude_patterns": ["cake", "vendor", "node_modules", "Project/components"],

should work just fine.

Upvotes: 2

Related Questions