Is there a way to swap the include* / exclude* property order in TM2?
I have a project that is comprised of shared code used by many different projects. Every time another developer adds files and directories to their area of the source tree I have to add another exclude value in my .tm_properties. Ideally I would like to exclude everything and only include the directories and files that are specific to what I'm working on.
Reading the TM docs, it appears that the order is first to parse the "include*" (which defaults to everything) then parse the "exclude*." Because of this I can't figure how to, by default, exclude everything and only include what I'm interested in.
Thanks for any help.
-- DV
-- View this message in context: http://textmate.1073791.n5.nabble.com/exclude-include-in-tm-properties-tp291... Sent from the textmate users mailing list archive at Nabble.com.
I can't figure how to, by default, exclude everything and only include what I'm interested in.
If I've understood you correctly, I think it does in fact work the way you want it to. Have you tried including the files you are working on and leaving out the exclude?
eg:
include = 'src,test'
would only include the src and test directories without the need to exclude anything. You could then exclude anything you didn't want within those directions with your exclude.
Cheers, George
Thank you for the suggestion - yes that works!
I've always had my include also include the default settings (e.g. include = "{$include, ...}") which has the default of "*". I don't know why it never occurred to me to override the includes to only be what I want.
Best,
-- dv
-- View this message in context: http://textmate.1073791.n5.nabble.com/exclude-include-in-tm-properties-tp291... Sent from the textmate users mailing list archive at Nabble.com.
All is working great as far as the folders/files that show up in my project pane and file chooser. However I think there might be a bug with the folder search. If I use "Find In Project," I get matches for all references in all files. It doesn't appear the find is only looking at files that match the $includeInFolderSearch (or the inherited $include / $includeDirectories) setting.
It seams the only way to exclude is via the $excludeInFolderSearch variable.
Does anyone else see the same issue, or is it something I'm still doing wrong?
Thanks,
-- dv
-- View this message in context: http://textmate.1073791.n5.nabble.com/exclude-include-in-tm-properties-tp291... Sent from the textmate users mailing list archive at Nabble.com.
On 24 Apr 2015, at 20:53, dvlogic wrote:
[…] If I use "Find In Project," […] It doesn't appear the find is only looking at files that match the $includeInFolderSearch (or the inherited $include / $includeDirectories) setting.
It seams the only way to exclude is via the $excludeInFolderSearch variable.
There is no includeInFolderSearch setting because it uses the “matching” glob shown in the find window as what to include.
So for your project, you would need to edit this field, to only include the folders you’re interested in searching. This setting will be remembered “per project” (folder).
In theory you can also negate an exclude pattern to make it instead work as an include pattern, for example if you only want to search items in ‘src’ then you can set the excludeInFolderSearch to ‘!src{/**,}’. The brace notation here is to both (not) exclude ‘src’ (the folder) and any item below the folder (‘src/**’).
Allan Odgaard-4 wrote
There is no includeInFolderSearch setting because it uses the “matching” glob shown in the find window as what to include.
So for your project, you would need to edit this field, to only include the folders you’re interested in searching. This setting will be remembered “per project” (folder).
Is it possible to use environment and/or .tm_properties variables in the “matching” glob field?
Example, if my $includeDirectories was equal to “{portable,product/{platform1, platform2}},” I would like to set the “matching” glob to “$includeDirectories/*.{c,h}” and have it only search for files in included directories path.
Thanks,
-- dv
-- View this message in context: http://textmate.1073791.n5.nabble.com/exclude-include-in-tm-properties-tp291... Sent from the textmate users mailing list archive at Nabble.com.
Allan Odgaard-4 wrote
In theory you can also negate an exclude pattern to make it instead work as an include pattern, for example if you only want to search items in ‘src’ then you can set the excludeInFolderSearch to ‘!src{/**,}’. The brace notation here is to both (not) exclude ‘src’ (the folder) and any item below the folder (‘src/**’).
Thanks for this suggestion. I just changed all my include.. to exclude.. patterns that not'ed (!) what I originally had as the include.. pattern. This works great and also solves my issue with the folder search.
Thanks!
-- View this message in context: http://textmate.1073791.n5.nabble.com/exclude-include-in-tm-properties-tp291... Sent from the textmate users mailing list archive at Nabble.com.