Exclude/Include 在 sublime 中不同的同名文件夹

Exclude/Include folders differently with the same name in sublime

我想排除一个文件夹,但只排除根目录中的文件夹。

//project-name.sublime-project

{
    "folders":
    [
        {
            "path": "/path/to/project",
            "folder_exclude_patterns": ["?"]
        }
    ]
}

我在 Sublime 论坛上找到了 this,他们在那里谈论 root_dir。但这并不完全是 root_dir,它只是一种恰好适合他们的模式。可能是 any_name_dir。对我来说不幸的是,我在树的更下方有完全相同的名称模式。

我的结构:

app_name
├── src
│   ├── app_name
│   │   ├── static
│   │   └── templates
│   ├── other1
│   └── other2
└── static    <----

是否可以只排除根目录中的 static 文件夹,又名 app_name 例如。

"folder_exclude_patterns: ["./static"]"

目前没有专门排除文件夹/文件的内置方法。

folder_exclude_patternsfile_exclude_patterns 输入被视为通配符。


但是,您可以按如下方式使用 folder_include_patterns

(如果文件夹太多会变得很荒谬)

{
  "path": ".",
  "folder_include_patterns": ["src"],
}

这将仅包含 src 目录及其子目录,并忽略其他文件夹。