Home Download Buy Blog Forum Support

New find in files, exclude dirs?

Re: New find in files, exclude dirs?

Postby fougazi on Wed Feb 29, 2012 10:06 am

This is also an issue here

When working on big Django project, model migrations files generated by South are numerous and big, and completely pollute search results.

RM
fougazi
 
Posts: 1
Joined: Wed Feb 29, 2012 10:03 am

Re: New find in files, exclude dirs?

Postby adam on Thu Mar 29, 2012 11:53 am

Please fix this!! :P
adam
 
Posts: 1
Joined: Thu Mar 29, 2012 11:52 am

Re: New find in files, exclude dirs?

Postby nova77 on Thu Mar 29, 2012 12:47 pm

Since we're about it, why not also completing the picture and adding "include_patterns"?
See http://sublimetext.userecho.com/topic/5 ... ct-config/
nova77
 
Posts: 7
Joined: Tue Sep 13, 2011 9:54 am

Re: New find in files, exclude dirs?

Postby jps on Thu Mar 29, 2012 1:00 pm

Find in Files has always supported include pattens, and as of nightly 2191, dirs can be excluded
jps
Site Admin
 
Posts: 3217
Joined: Wed Mar 19, 2008 12:33 pm

Re: New find in files, exclude dirs?

Postby tito on Thu Mar 29, 2012 1:59 pm

The addition of exclude dirs from find and replace is very welcome and appreciated.

The problem presented in this thread is a little bit different. As suggested by ludder a preference in projects to control "folder_exclude_patterns" would be useful.

Whenever I search inside a project I get results from ".git" folders and other folders that I wish to exclude always from search results.

Writing -.git will probably work but is not that practical.

Regards
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 983
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: New find in files, exclude dirs?

Postby jps on Thu Mar 29, 2012 2:11 pm

folder_exclude_patterns already exists for projects: http://www.sublimetext.com/docs/2/projects.html
jps
Site Admin
 
Posts: 3217
Joined: Wed Mar 19, 2008 12:33 pm

Re: New find in files, exclude dirs?

Postby tito on Thu Mar 29, 2012 3:28 pm

Yes, sorry.

I was referring to the possibility to actually show a folder in sidebar but exclude it from Find and Replace.

My opinion is that showing a folder in sidebar and exclude it from Find and Replace are two different unrelated things.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 983
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: New find in files, exclude dirs?

Postby borekb on Tue Jun 19, 2012 11:19 am

jps wrote:Find in Files has always supported include pattens, and as of nightly 2191, dirs can be excluded


A slightly confusing thing is that the exclude filter for a directory has to be written like this:

-*/dirtoexclude/*

instead of a simpler

-*dirtoexclude*

Or maybe I'm just not used to how ST2 handles filters yet (and haven't found proper documentation on it).
borekb
 
Posts: 21
Joined: Wed Mar 14, 2012 4:11 pm

Re: New find in files, exclude dirs?

Postby cymatist on Fri Mar 06, 2015 2:00 am

Thanks folks. "folder_exclude_patterns" was all I needed for my purposes.
Good luck with the further feature requests.
cymatist
 
Posts: 1
Joined: Fri Mar 06, 2015 1:55 am

Re: New find in files, exclude dirs?

Postby crawfordcomeaux on Fri Jun 19, 2015 1:54 am

In case anyone else comes here looking for how to exclude all subdirectories (ie. subfolders), as I just did, here's what I found works:

Code: Select all
-<project root directory name, not path>/*/*


If the folder is named 'scripts', it'd be:
Code: Select all
-scripts/*/*


If there are two root folders foo and bar, and you only want to search through their files, but not the folders they contain, you'd use

Code: Select all
-foo/*/*,-bar/*/*


I also tried -(foo|bar)/*/* but it didn't work. Anyone know if there's a shorter syntax that what I've got here?
crawfordcomeaux
 
Posts: 2
Joined: Mon Aug 25, 2014 4:08 am

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 18 guests