Sublime Forum

In filesearch (Ctrl+p), include only files with file extensions

#1

Hi,

So when I use the ingenious fuzzy-search show files command with Ctrl+p, I have excluded all manner of
files with:

“file_exclude_patterns”:["*.zip"]

and so on.

however, some auxillary files without file extensions are still coming up, for example a file called:

[project/working directory]/.Rproj.user/F0281943/sources/prop/1D3D1EFE

cluttering and obstrueing the files that are actually of interest to me. So I thought, “is there a way to include only files that have a file extension, whatever that extension might be?”

My best bet what this:

“file_include_patterns”:
[
/.*$”
]

or simply

“file_include_patterns”:
[
.
]

This is a failed attempt to use regex, however using the \ in order to read the “.” as litteral failes, which makes me think it’s not using regex but something else.

IS there anyway to do this?
so this file should be included:

(…)/rscripts/script01.r

and this should’t - but it still has a punctuation mark in the name of the folder, so we can’t just exclude all filepaths with punctuation (it is unclear to me wether the file_include_pattern looks at the filepaths as well. I would think not, but…)

(…)/.hidden_folder/D01aKsdfEW

Thank you,
Emil

0 Likes

#2

I’m fairly certain file_include_patterns are glob based patterns. ["*.*"] should work for you. You can see examples in the settings under folder_exclude_patterns & file_exclude_patterns.

0 Likes

#3

It does not - I tried it with a file called sublime-test (no file extension), in a filepath with no punctiation marks in it, just to make sure that it wasn’t pickin up on the filepath instead of the filename.

I tried something else: closing all files, using only file_include_patters, setting it to:

“file_include_patterns”:
[
sublime-test
],

did not work either - it was still finding all the other files (excePt the ones defined as not searchable in the file_exclude_patterns. So it seems like file_include_patterns is just not working at all. Strange.

0 Likes

#4

It’s not working for me as well, did you find a solution?

0 Likes