19

I need node_modules in the sidebar but not when searching files, "go to files".

If I use

{
  "folder_exclude_patterns": [ "node_modules"]
}

It works ok except for the sidebar.

2 Answers 2

43

Sublime text -> Preferences -> Settings-> opens a new window with all the program settings on the left and your user settings on the right. You would add this line between the {} brackets -

"binary_file_patterns": [".svn/", ".git/", "node_modules/", "bower_components/"]
Sign up to request clarification or add additional context in comments.

Comments

9

You need this setting binary_file_pattern:

    // These files will still show up in the side bar, but won't be included in
    // Goto Anything or Find in Files
    "binary_file_patterns": ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"],

You can also use:

// index_exclude_patterns indicate which files won't be indexed.
"index_exclude_patterns": ["*.log"],

It's will show it in sidebar, but remove it from any index.

You can also try this plugin: https://github.com/titoBouzout/SideBarFolders

For some users.. (me :P), the ST project system is too much.. I just want to be able to switch folders without saving or tracking project files, and keeping Tabs intact.. well, this package does just that.

1 Comment

tried both in different variations ("node_modules", "node_modules/*") using sublime3, Linux, build 3126: not working

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.