I only see "ignore_regexes" option in the Sublime SFTP config.json. Is there any way to include only certain files, for example, .h, .c and .cpp files alone from all the subfolders under the mapped folder?
Asked
Active
Viewed 245 times
1 Answers
1
Looking at the documentation for the package, the only setting that looks like it would do something like this is the ignore_regexes
option that you've already found.
As such, I think the only way to do what you want would be to use a regular expression that matches everything but the files that you're interested in so that it ignores all files except the ones that you want to view.
An example of such a regular expression (which I only midly tested but seems to work) is the following (adapted from this question):
^(.(?!\.(c|h|cpp)))*$
In use, as mentioned in the documentation examples you should use \\
instead of \
in the config file since it's JSON and \
has special meaning in JSON data.

OdatNurd
- 21,371
- 3
- 50
- 68
-
so it would look something like ^(.(?!\\.(c|h|cpp)))*$ ...? – Venkat Krishnan Jul 11 '19 at 00:50
-
Yeah, I think that should work. I didn't apply it in SFTP specifically but I did test that it matches only files that aren't that type and verified that it works in the Python `re` module that SFTP uses and it seems to work for me. – OdatNurd Jul 11 '19 at 00:55