Sublime Forum

Exclude several folders from search... sort of

#1

I have this thing: i just discovered real capabilities of CodeIntel when i accidentally opened the whole WordPress folder as a project (instead of theme i worked on). Clicking on function name will worked like magic and finding docs/reading WP core code were easier than EVER.

However, the main problem was the “go to anything”, more exactly the file part, since searching for function.php, for example, will bring up about 10 files. Which, obviously, it’s not what i’m expecting.

So, my question is: since i use main WordPress folder only for codeintel, it is possible to limit “go to anything” to work only on wp-content/themes/my_theme ?

Thanks!

0 Likes

#2

binary_file_patterns setting is supposed to work that magic.
As expressed in default settings file

// 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"]

The problem I had with it is that it doesn’t work on a per project basis.
Is that your problem?
http://sublimetext.userecho.com/topic/124477-binary_file_patterns-in-project-settings-doesnt-work/

0 Likes

#3

Thanks for the tip. Unfortunately, there is more. Because I kinda need to exclude whole folders.
Actually let’s say we have this (standard) WP structure:

[quote]wp-admin
wp-content
wp-content/plugins
wp-content/themes
wp-content/themes/twenty*
wp-content/themes/my_theme
wp-includes
wp-*.php[/quote]

So i kinda want to exclude everything that is NOT in wp-content/themes/my_theme from search, but be available on code intel.

Dunno if i explain well, but it makes a lot of sense inside my head! :mrgreen:

0 Likes

#4

yes i got you right.
don’t be tripped by the name of the setting.
you can add wp-content/themes/my_theme to your list of patterns and it should filter all files/folders whose path match that pattern.
as i said i could’t figure how to set that in project settings.
try it in your user settings.

0 Likes

#5

Uhm… And how i can ignore anything but one subfolder? :open_mouth:
Thanks!

0 Likes

#6

Ok, so i did a quick test on a small folder and seems to work ok (code intel still got the function that was into an ignored file).
But the main issue still remain: how do i ignore all other files?

Or, at least, how do i prioritize to find first files inside my project, and then inside wp files?

0 Likes

#7

i’d be interested to learn more about different patterns we can construct as im just playing around with them.

0 Likes