Sublime Forum

Exclude files & directories from "Find in Files"

#1

It would be useful to be able to exclude certain files and directories from the “Find in Files” search, such as Subversion’s “.svn” directories.

I’m thinking something like “find.direxclude” and “find.exclude” options that would work like the “project.direxclude” and “project.exclude” options.

0 Likes

Find in Files - Ignore Subdirectory?
New find in files, exclude dirs?
#2

+1

Sounds very useful.

0 Likes

#3

You can exclude files and directories by including them in the search pattern with a “-” prefix, for example:

*.*;-*.css;-*CVS*

Will search all files, skipping over .css files and skipping anything with CVS in the path

0 Likes

#4

Thanks for the tip. I still think being able to always have certain files/directories excluded would be useful, but this’ll work.

0 Likes

#5

As a note to others, this doesn’t work at the directory level. When I try searching in <project>;-C:\www\bugbot3\vendor\ it searches in the whole project and then tells me “Unable to open -C:\www\bugbot3\vendor”.

Instead, you have to put “.;-C:\www\bugbot3\vendor*.*” in the third field, not second.

0 Likes