Ignoring files and folders in Sublime Text

Published:

I love the file search (ctrl+shift+f) and quick navigate (ctrl+p) in Sublime Text. What can be annoying however is when these present you with library code in your project, files related to source control, binary files or minified files.

Since I keep forgetting how to clean that up, here's a note to self (and others) on how to clean that up. Easy peasy.

  1. Save as project (if you haven't already)
  2. Edit project file
  3. Add file_exclude_patterns and/or folder_exclude_patterns to the folders section.

Below is an example from one of my current projects which excludes the git repo folder, a cache folder, minified files and some binary files.

{
  "folders": [
    {
      "path": "/D/dev/www/some-website",
      "folder_exclude_patterns": [".git", ".cache"],
      "file_exclude_patterns": ["*.mp3", "*.ogg", "*.pdf", "*.min.*"]
    }
  ]
}