Prevent Sublime Text publishing from searchable .sublime-workspace files.

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 look at all my open files and folders in the sidebar (cmd-shift-f), I still get search results, including workspace files that live in one of the directories that I opened. For example, if I have ~/foo open and have a file ~/foo/bar/hello.sublime-workspace , it will be included in the search results.

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

+7
sublimetext2 sublimetext
source share
3 answers

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

  • Use a negative template in the "Where:" field "Find in files ...": -*.sublime-workspace
  • In your settings file in the "folders" section add "binary_file_patterns": ["*.sublime-workspace"]

Edit

In fact, you just need to specify "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 can have the option folder_exclude_patterns and file_exclude_patterns.

+2
source share

You can add a filter by adding " , - *. 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 in a specific directory.

+1
source share

This answers the title of the question, but for a problem that may arise in the configuration of the project level.

It is a reported error that binary_file_patterns does not work based on each project. Except that this sometimes happens. In any case, this worked for me when I moved the project workspace exception from binary_file_patterns to the exclude_patterns file.

Another problem that you might not suspect is that if you open a directory with subl . he does not load the project. You need to go to "Sublime> Project" and "open project" for the settings to take effect. Yes, that’s terrible.

+1
source share

All Articles