7

这是我的Preferences.sublime-settings文件:

{
    "bold_folder_labels": true,
    "highlight_line": true,
    "ignored_packages":
    [
        "Vintage"
    ],
    "remember_open_files": true,
    "folders":
    [
        {
         "file_exclude_patterns": ["*.sublime-workspace"]
        }
    ]
}

当我在边栏中搜索所有打开的文件和文件夹(cmd-shift-f)时,我仍然会得到搜索结果,包括位于我打开的目录之一中的工作区文件。例如,如果我~/foo打开并且有一个文件~/foo/bar/hello.sublime-workspace,它就会包含在搜索结果中。

如何让 Sublime永远不要.sublime-workspace在我的搜索中包含文件?

4

3 回答 3

2

According to the comments here it looks like you have two possible solutions:

  1. Use a negated pattern in the "Where:" field of "Find in Files...": -*.sublime-workspace
  2. In your settings file in the "folders" section, add "binary_file_patterns": ["*.sublime-workspace"]

Edit

Actually, you may just need to specify a "path" for your "file_exclude_patterns":

"folders":
[
    {
        "path": "./",
        "file_exclude_patterns": [".sublime-workspace"]
    }
]

From http://www.sublimetext.com/docs/2/projects.html:

Each folder must have a path, and may optionally have a folder_exclude_patterns and file_exclude_patterns setting.

于 2013-10-04T13:29:57.243 回答
1

这回答了问题标题,但解决了项目级配置中可能出现的问题。

这是一个报告的错误,即 binary_file_patterns 不能在每个项目的基础上工作。除了它有时会。无论如何,当我将项目的工作区排除从 binary_file_patterns 移动到 file_exclude_patterns 时,这对我有用。

您可能不知道的另一个问题是,如果您使用 来打开目录subl .,它不会加载项目。您需要进入“Sublime > Project”和“open project”才能使设置生效。是的,这太可怕了。

于 2015-02-15T21:48:13.787 回答
1

您可以通过将“ ,-*.sublime-workspace ”附加到Where旁边的目录来添加过滤器:

例如,设置Where to

<project>,-*.sublime-workspace

搜索所有项目目录,或

c:\mydir,-*.sublime-workspace

搜索特定目录。

于 2014-09-25T01:52:13.063 回答