Home Download Buy Blog Forum Support

Exclude directory from Go To Anything

Exclude directory from Go To Anything

Postby shatrov on Wed May 30, 2012 11:41 pm

Hello,

I use Go To Anything (Cmd+P) many times every day, but there are some system directories in my project. Is it possible to exclude several dirs from "Go To Anything"?
shatrov
 
Posts: 2
Joined: Wed May 30, 2012 11:34 pm

Re: Exclude directory from Go To Anything

Postby C0D312 on Thu May 31, 2012 1:04 am

From Preferences > Settings - Default:

    // folder_exclude_patterns and file_exclude_patterns control which files
// are listed in folders on the side bar. These can also be set on a per-
// project basis.
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS"],
"file_exclude_patterns": ["*.pyc", "*.pyo", "*.exe", "*.dll", "*.obj","*.o", "*.a", "*.lib", "*.so", "*.dylib", "*.ncb", "*.sdf", "*.suo", "*.pdb", "*.idb", ".DS_Store", "*.class", "*.psd", "*.db"],
// 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"],


To override this, add it to Preferences > Settings - User.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Exclude directory from Go To Anything

Postby stirrell on Fri Jun 01, 2012 12:33 am

This tip came in handy for me. I use the CTAGs package and was tired of getting results from .tags and .tags_sorted_by_file in my results. I added both of these files in my default settings exclude filter and solved it for all my project-wide searches. Thanks for the help!
stirrell
 
Posts: 12
Joined: Thu Jan 12, 2012 4:04 pm
Location: South Portland, ME

Re: Exclude directory from Go To Anything

Postby vitaLee on Wed Aug 29, 2012 4:28 pm

is "binary_file_patterns" supposed to work on a per project basis?
im trying this
Code: Select all
{
   "folders":
   [
      {
         "path": "/Users/vitalee/Projects/Test",
      "binary_file_patterns": ["config/*.rb"]
      }
   ]
}


i expected all .rb files in config to be filtered from goto list but they're not.
shed some light please.
vitaLee
 
Posts: 150
Joined: Tue Dec 27, 2011 11:10 pm

Re: Exclude directory from Go To Anything

Postby Jay Levitt on Thu Aug 30, 2012 3:00 pm

I would bet that "binary_file_patterns" is only applied to the filename portion, not the path, so you can't use "config/*.rb" as a pattern. I'd love to be wrong or to hear another way, though; I have a similar problem, system directories that I want to be able to browse but that I don't want to appear in Go To Anything.
Jay Levitt
 
Posts: 52
Joined: Sun Sep 25, 2011 6:22 pm

Re: Exclude directory from Go To Anything

Postby vitaLee on Thu Aug 30, 2012 8:03 pm

Don't bet much, because it works as expected when pattern is added in global or user settings file. :)
it's just ignored on a project level.
created a topic on userecho http://sublimetext.userecho.com/topic/124477-binary_file_patterns-in-project-settings-doesnt-work/
go and vote if you care
vitaLee
 
Posts: 150
Joined: Tue Dec 27, 2011 11:10 pm

Re: Exclude directory from Go To Anything

Postby eighteyes on Thu Feb 13, 2014 4:56 pm

I wanted to add that this removes the matching files / folders from your whole project, not just from the search.

I can see a solid use case for wanting to remove something from the search, to make it easier to find things in lists, and not wanting to hide it from the project entirely.
eighteyes
 
Posts: 1
Joined: Thu Feb 13, 2014 4:54 pm


Return to General Discussion

Who is online

Users browsing this forum: jbjornson, Yahoo [Bot] and 20 guests