Sublime Forum

Exclude files without extensions from project?

#1

My project generates several executable files which follow the usual Unix convention of not having an extension on their name. How do I exclude those files from my project? I’ve tried a couple of things in the “file_exclude_patterns” setting, but haven’t succeeded.

1 Like

#2

Anyone?

0 Likes

#3

Please list the file name in question, and the filter that you’re trying to use to exclude it.

0 Likes

#4

It’s not just one file. That’s easy. It’s about a dozen files, so I’d prefer not to exclude each one individually.

The files have names like:

tfloat
tdouble
tlong_double

there are corresponding files with a .c extension:

tfloat.c
tdouble.c
tlong_double.c

that should not be excluded. If I wanted to exclude them, the expression would be “*.c”. Haven’t figured out how to say “doesn’t have a ‘.’”.

0 Likes

#5

Unfortunately there’s no wildcard that will match all files with no extension, the only option is to use a set of patterns along the lines of “tfloat”, “tdouble”, “tlong_double”].

0 Likes

#6

That’s what I figured. Thanks.

Oh, and a minor suggestion: grep has -v, to return lines that don’t match the regular expression. Maybe something similar for matching in the exclude_xxx contexts? “!.”?

0 Likes

#7

Works in ST2/ST3

{
  "path": ".",
  "file_include_patterns": ["*.*"],
  "file_exclude_patterns": ["*.sublime-project"], // or anything you like
}
0 Likes