Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Sublime Text from including .sublime-workspace files in search

Here is my Preferences.sublime-settings file:

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

When I search all of my open files and folders in the sidebar (cmd-shift-f) I still get search results including workspace files which live in one of the directories which I have open. For instance, if I have ~/foo open and there's a file ~/foo/bar/hello.sublime-workspace, it gets included in the search results.

How do I get Sublime to never include .sublime-workspace files in my searches?

like image 698
2rs2ts Avatar asked Oct 04 '13 13:10

2rs2ts


2 Answers

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.

like image 132
André Dion Avatar answered Oct 28 '22 04:10

André Dion


You can add a filter by appending ",-*.sublime-workspace" to your directory next to Where:

For example, set Where to

<project>,-*.sublime-workspace

to search all your project directories, or

c:\mydir,-*.sublime-workspace

to search a specific directory.

like image 22
Jonathan Lidbeck Avatar answered Oct 28 '22 04:10

Jonathan Lidbeck