I can’t seem to get the watch/indexing exclusion settings working.
I am using bazel as a build system for my project and it creates a ton of symlinks and files. All build outputs go into bzl-build
folder and sublime puts a ton of load on RAM and CPU and reaches the max inotify watchers (which can’t be increased further cause the max possible setting has been reached).
I want to tell sublime to stop indexing everything in bzl-build
and ignore it completely, but it doesn’t seem to work. In my Preferences.sublime-settings
I have only changed index_workers
to 4 to reduce any possible load (the rest of the settings are untouched)
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", ".Trash", ".Trash-*"],
"file_exclude_patterns": ["*.pyc", "*.pyo", "*.exe", "*.dll", "*.obj","*.o", "*.a", "*.lib", "*.so", "*.dylib", "*.ncb", "*.sdf", "*.suo", "*.pdb", "*.idb", ".DS_Store", ".directory", "desktop.ini", "*.class", "*.psd", "*.db", "*.sublime-workspace"],
"binary_file_patterns": ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"],
"index_files": true,
"index_workers": 4,
"index_exclude_gitignore": true,
"index_skip_unknown_extensions": true,
"index_exclude_patterns": ["*.log"],
"goto_anything_exclude_gitignore": false,
Since in my .gitignore I have /bzl-build/
entry and index_exclude_gitignore
I would expect that sublime won’t index anything inside. However, it looks like sublime is still doing some work on the bzl-build
folder, cause when I remove the folder from disk, sublime’s CPU and RAM usage go down significantly.
I also tried using the following .sublime-project
, but it made little difference:
{
"folders":
[
{
"path": ".",
"folder_exclude_patterns": ["bzl-build"],
"index_exclude_patterns": ["bzl-build"],
},
{
"path": "bzl-build",
"file_exclude_patterns": ["*"],
"folder_exclude_patterns": ["*"],
"index_exclude_patterns": ["*"],
},
],
}
I also tried adding "*/bzl-build/*"
to binary_file_patterns
and set "goto_anything_exclude_gitignore": true,
, but it didn’t seem to make a lot of difference.
What’s the correct way to tell sublime to completely ignore the bzl-build
folder and everything inside such that sublime won’t do any work on analyzing it (equivalent to bzl-build
being removed from disk)?
UPDATE: Setting index_files
to false
in .sublime-project
doesn’t seem to make a difference either.