Leantraxxx
Leantraxxx

Reputation: 4606

Hide files/folders on my search but not in my side bar

I'm using sublime text 3 and I want to exclude files/directories but not in my sidebar.

For example...

I have those files:

  1. /doc/blabla/event.rb with the text some content in it.
  2. /app/event.rb with the text other content in it.

So, with Ctrl + P (find files) and writing "event" I want to see only /app/event.rb.

and, with Ctrl + Shift + F (find in all files) and writing "content" I want to see results, again, only for /app/event.rb

I configure sublime with this values into my Preferences.sublime-settings:

"folder_exclude_patterns": ["doc"],

this works beautifully but, it hides doc directory from sidebar too. I don't want this behavior. I only want to hide files from my search

Upvotes: 17

Views: 1474

Answers (3)

bonafernando
bonafernando

Reputation: 1159

I have stumbled upon the same problem. Recently I've been trowing every project that I'm not currently working to a .old folder and it became really annoying as the suggestions of Sublime are ordered it always in first place, so I did the same as @Typenine suggested and put it in binary_file_patterns. It is working great:

"binary_file_patterns": ["*/.old/*", "*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"]

Upvotes: 0

Typenine
Typenine

Reputation: 206

For me, using Sublime 3 build 3083 binary_file_patterns was not working while I had the setting in the project.sublime-project file. Once I moved it to my Preferences.sublime-settings and added an '*' to the search it started excluding the folder from search results while leaving it in the sidebar. My Preferences.sublime-settings looks like so:

"binary_file_patterns":
    [
    "public/bower_components/*",
    "public/javascripts/vendor/*",
    "public-built/*"
    ],

and it works beautifully for me in sublime 3.

Also talked about in this post: http://blog.lysender.com/2014/08/sublime-text-exclude-files-or-directories-from-go-to-anything-feature/

Upvotes: 19

skuroda
skuroda

Reputation: 19744

You aren't looking for folder_exclude_patterns, rather binary_file_patterns. Check the default settings for the current values in case you woul dlike to keep the default values. I don't know if it works on folders, so you'll have to try it out.

Upvotes: 2

Related Questions