is it possible to hide all the files with certain extension from the sidebar (lateral nav bar) in Sublime Text Editor 3?
2 Answers
Are you talking about the sidebar? For example, if you select File → Open and select a folder, then the folder and its contents are displayed along the left side, allowing you to navigate amongst its contents and sub-directories. If that is the case, then the answer is yes, files can be excluded.
Select Preferences → Settings – Default to open a tab called Preferences.sublime-settings – Default
. This file is read-only, so you'll also need to open Preferences → Settings – User. The first time you open your user preferences it will be blank. It (and all Sublime config files) are in the JSON format, so you'll need opening and closing curly braces at the beginning and end of the file, respectively:
{
}
Activate the default preferences tab and search for file_exclude_patterns
(which is on line 377 in ST3 build 3083) and also folder_exclude_patterns
if desired. Copy its contents to your user preferences file, like so:
{
"file_exclude_patterns": ["*.pyc", "*.pyo", "*.exe", "*.dll", "*.obj","*.o", "*.a", "*.lib", "*.so", "*.dylib", "*.ncb", "*.sdf", "*.suo", "*.pdb", "*.idb", ".DS_Store", "*.class", "*.psd", "*.db", "*.sublime-workspace"]
}
and feel free to add your own customizations. Please note that there is no comma (,
) after the closing square bracket, as in this example this is the only customized preference. If you have multiple ones (changing fonts, window options, themes, or whatever) you'll need a comma after each item except the last one (trailing commas are illegal JSON):
{
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"word_wrap": true,
"wrap_width": 0
}
-
13It's probably simpler to just say: the settings files are written in JSON.– pdpiFeb 17, 2014 at 11:46
-
10Ahhhhhhhh, it was hiding the files I needed. Ahahhahahgghghghghghhg . . . cries– meawopplAug 1, 2014 at 22:43
-
1Thanks - just made my development experience a whole lot better :) Apr 27, 2015 at 8:45
-
1@Matt I added a reference to the folder pattern because this shows up fairly high in a search I did about them.– Nick TJun 7, 2015 at 23:23
-
You can also set them up per project and ignore folders, in your .sublime-project
file, e.g.:
{
"folders": [{
"path": ".",
"folder_exclude_patterns": [".svn", "._d", ".metadata", ".settings"],
"file_exclude_patterns": ["*.pyc", "*.pyo", ".project"]
}]
}
-
-
4You can also use "binary_file_patterns" to hide the folder/files in search, but still see it in the sidebar.– gkielyMay 26, 2016 at 0:09
-
9For anyone else wondering how to create this file, in the top menu go to
Project > Save Project As
and you can then paste this into that file and it works. Creating your own file withtouch
won't work the same :)– soflySep 14, 2016 at 0:48 -
1Thanks! I've been trying to figure out how to hide all the .js files inside of my project's dist folder, but not .js files anywhere else :) first time using the
.sublime-project
Mar 2, 2017 at 20:27 -
1to hide all dot files in sublime, use
".*"
within 'folder_exclude_patterns"– JulianAug 2, 2017 at 18:03