Discussion:
[TxMt] Searching in hidden files
Jacob Carlborg
2018-10-27 12:03:10 UTC
Permalink
By default TextMate won’t show hidden files (files starting with a dot) in the file browser. It’s possible to configure TextMate to show some of these files anyway, I’ve done that for files like .travis.yml. When doing a project wide search it won’t search those files, even though they’re visible in the file browser. Is that a bug, missing feature or an additional setting?
--
/Jacob Carlborg
Allan Odgaard
2018-10-27 13:24:35 UTC
Permalink
Post by Jacob Carlborg
By default TextMate won’t show hidden files (files starting with a
dot) in the file browser. It’s possible to configure TextMate to
show some of these files anyway, I’ve done that for files like
.travis.yml. When doing a project wide search it won’t search those
files, even though they’re visible in the file browser. Is that a
bug, missing feature or an additional setting?
The file browser has its own glob: The contents of the “matching”
field.

Since `*` does not match hidden files, you will need to also update this
pattern to include `.travis.yml` and friends.

It’s problematic to combine the file dialog’s glob with the global
include/exclude patterns, because it would then be hard to limit the set
of searched files without also editing the global patterns.

What could perhaps be an option is to allow enabling/disabling the find
dialog’s pattern, so when disabled, it would use the global patterns.
Perhaps empty pattern should just be = use global patterns.

Personally though, I basically always have custom find dialog patterns
for my various projects, e.g. exclude `vendor/`, generated content, etc.

Though let me also say that I do think that there are too many
include/exclude patterns that can be configured in TextMate, it’s
something I would like to simplify, and I’ve added a note about this
issue to my design document.
Jacob Carlborg
2018-10-27 13:28:20 UTC
Permalink
The file browser has its own glob: The contents of the “matching” field.
Since * does not match hidden files, you will need to also update this pattern to include .travis.yml and friends
Are you referring to the “matching” field in the search dialog? Is this possible to configure globally? Ideally I would like to .travis.yml to always be included, regardless of what I have in the “matching” field.
--
/Jacob Carlborg
Allan Odgaard
2018-10-27 13:46:01 UTC
Permalink
Post by Jacob Carlborg
Are you referring to the “matching” field in the search dialog? Is
this possible to configure globally? Ideally I would like to
.travis.yml to always be included, regardless of what I have in the
“matching” field.
Try run this in a terminal:

defaults write com.macromates.TextMate "Find in Folder Globs" '{
default = ( "{*,.travis.yml}" ); }'

Then the default pattern should be `{*,.travis.yml}` but if you make
changes to the pattern via the Find dialog, it’ll only be for the
current project folder.
Jacob Carlborg
2018-10-27 13:47:46 UTC
Permalink
I’ll give it a try, thanks.
--
/Jacob Carlborg
Are you referring to the “matching” field in the search dialog? Is this possible to configure globally? Ideally I would like to .travis.yml to always be included, regardless of what I have in the “matching” field.
defaults write com.macromates.TextMate "Find in Folder Globs" '{ default = ( "{*,.travis.yml}" ); }'
Then the default pattern should be {*,.travis.yml} but if you make changes to the pattern via the Find dialog, it’ll only be for the current project folder.
_______________________________________________
textmate mailing list
https://lists.macromates.com/listinfo/textmate
Rob J. Goedman
2018-10-27 21:49:29 UTC
Permalink
No luck here.

After executing below command, a line is indeed added to com.macromates.TextMate.plist:

```
ExpandedURLs = ( "file:///Users/rob/.julia/dev/CmdStan/docs/ <file:///Users/rob/.julia/dev/CmdStan/docs/>", "file:///Users/rob/.julia/dev/CmdStan/docs/src/ <file:///Users/rob/.julia/dev/CmdStan/docs/src/>" );
"Find in Folder Globs" = { default = ( "{*,.travis.yml, .git}" ); };
LRUDocumentPaths = ( "/Users/rob/Library/Preferences/com.macromates.TextMate.plist", "/Users/rob/.julia/dev/CmdStan/docs/make.jl",
```

But neither .travis.yml nor .git show up in the File Browser. Would be really nice though!

Rob J Goedman
Post by Jacob Carlborg
I’ll give it a try, thanks.
--
/Jacob Carlborg
Are you referring to the “matching” field in the search dialog? Is this possible to configure globally? Ideally I would like to .travis.yml to always be included, regardless of what I have in the “matching” field.
defaults write com.macromates.TextMate "Find in Folder Globs" '{ default = ( "{*,.travis.yml}" ); }'
Then the default pattern should be {*,.travis.yml} but if you make changes to the pattern via the Find dialog, it’ll only be for the current project folder.
_______________________________________________
textmate mailing list
https://lists.macromates.com/listinfo/textmate
_______________________________________________
textmate mailing list
https://lists.macromates.com/listinfo/textmate
Claudia Pellegrino
2018-10-28 09:06:35 UTC
Permalink
Hi Rob,

The file browser visibility is a separate setting. You can set it in Preferences » Projects » Include files matching. I’ve set it to {*,.*} so it shows all the files in the file browser.

As far as I know, the Include files matching setting is saved in the include property in ~/Library/Application Support/TextMate/Global.tmProperties.

Regards
Claudia




Am 27. Oktober 2018 um 23:49:40, Rob J. Goedman (***@icloud.com) schrieb:

No luck here.

After executing below command, a line is indeed added to com.macromates.TextMate.plist:

```
ExpandedURLs = ( "file:///Users/rob/.julia/dev/CmdStan/docs/", "file:///Users/rob/.julia/dev/CmdStan/docs/src/" );
"Find in Folder Globs" = { default = ( "{*,.travis.yml, .git}" ); };
LRUDocumentPaths = ( "/Users/rob/Library/Preferences/com.macromates.TextMate.plist", "/Users/rob/.julia/dev/CmdStan/docs/make.jl",
```

But neither .travis.yml nor .git show up in the File Browser. Would be really nice though!

Rob J Goedman
***@icloud.com


On Oct 27, 2018, at 07:47, Jacob Carlborg <***@me.com> wrote:

I’ll give it a try, thanks.

-- 
/Jacob Carlborg

On 27 Oct 2018, at 15:46, Allan Odgaard <***@textmate.org> wrote:

On 27 Oct 2018, at 20:28, Jacob Carlborg wrote:

Are you referring to the “matching” field in the search dialog? Is this possible to configure globally? Ideally I would like to .travis.yml to always be included, regardless of what I have in the “matching” field.
Try run this in a terminal:

defaults write com.macromates.TextMate "Find in Folder Globs" '{ default = ( "{*,.travis.yml}" ); }'
Then the default pattern should be {*,.travis.yml} but if you make changes to the pattern via the Find dialog, it’ll only be for the current project folder.


_______________________________________________
textmate mailing list
***@lists.macromates.com
https://lists.macromates.com/listinfo/textmate


_______________________________________________
textmate mailing list
***@lists.macromates.com
https://lists.macromates.com/listinfo/textmate


_______________________________________________
textmate mailing list
***@lists.macromates.com
https://lists.macromates.com/listinfo/textmate
Rob J. Goedman
2018-10-28 13:13:57 UTC
Permalink
Hi Claudia,

Thank you very much! Works great!

Best,
Rob J Goedman
Post by Claudia Pellegrino
Hi Rob,
The file browser visibility is a separate setting. You can set it in Preferences » Projects » Include files matching. I’ve set it to {*,.*} so it shows all the files in the file browser.
As far as I know, the Include files matching setting is saved in the include property in ~/Library/Application Support/TextMate/Global.tmProperties.
Regards
Claudia
Post by Rob J. Goedman
No luck here.
```
ExpandedURLs = ( "file:///Users/rob/.julia/dev/CmdStan/docs/ <file:///Users/rob/.julia/dev/CmdStan/docs/>", "file:///Users/rob/.julia/dev/CmdStan/docs/src/ <file:///Users/rob/.julia/dev/CmdStan/docs/src/>" );
"Find in Folder Globs" = { default = ( "{*,.travis.yml, .git}" ); };
LRUDocumentPaths = ( "/Users/rob/Library/Preferences/com.macromates.TextMate.plist", "/Users/rob/.julia/dev/CmdStan/docs/make.jl",
```
But neither .travis.yml nor .git show up in the File Browser. Would be really nice though!
Rob J Goedman
Post by Jacob Carlborg
I’ll give it a try, thanks.
--
/Jacob Carlborg
Are you referring to the “matching” field in the search dialog? Is this possible to configure globally? Ideally I would like to .travis.yml to always be included, regardless of what I have in the “matching” field.
defaults write com.macromates.TextMate "Find in Folder Globs" '{ default = ( "{*,.travis.yml}" ); }'
Then the default pattern should be {*,.travis.yml} but if you make changes to the pattern via the Find dialog, it’ll only be for the current project folder.
_______________________________________________
textmate mailing list
https://lists.macromates.com/listinfo/textmate <https://lists.macromates.com/listinfo/textmate>
_______________________________________________
textmate mailing list
https://lists.macromates.com/listinfo/textmate <https://lists.macromates.com/listinfo/textmate>
_______________________________________________
textmate mailing list
https://lists.macromates.com/listinfo/textmate <https://lists.macromates.com/listinfo/textmate>
_______________________________________________
textmate mailing list
https://lists.macromates.com/listinfo/textmate <https://lists.macromates.com/listinfo/textmate>
Allan Odgaard
2018-11-01 06:26:19 UTC
Permalink
Post by Jacob Carlborg
I’ll give it a try, thanks.
Turns out I was mistaken in how the default pattern is used, so I
introduced an explicit setting in rc.14 (see release notes).
Jacob Carlborg
2018-11-01 10:26:32 UTC
Permalink
Turns out I was mistaken in how the default pattern is used, so I introduced an explicit setting in rc.14 (see release notes).
I tried the new setting in tc.14. That’s not really the behavior I was looking for. Ideally I would like a set of hidden files to match when the “matching” field is set to “*”. What will happen is that sometimes I want to search in a limited set of files, then I change the “matching” field. Then I want to go back and search in all files, then I change the “matching” field to “*”, this is where I want some of the hidden files to be included. I don’t want to have to type out all of those hidden files every time do this. I know there’s a history, but contains a limited number of entries.
--
/Jacob Carlborg
Allan Odgaard
2018-11-10 07:26:09 UTC
Permalink
Post by Jacob Carlborg
I tried the new setting in tc.14. That’s not really the behavior I
was looking for. Ideally I would like a set of hidden files to match
when the “matching” field is set to “*”. What will happen is
that sometimes I want to search in a limited set of files, then I
change the “matching” field. Then I want to go back and search in
all files, then I change the “matching” field to “*”, this is
where I want some of the hidden files to be included. I don’t want
to have to type out all of those hidden files every time do this. I
know there’s a history, but contains a limited number of entries.
It sounds like you would like to define what `*` means so you can type
`*` as shorthand for a predefined glob.

I think this is what is normally handled with history, which TextMate
already supports.

I use history for find globs a lot myself, and have not found that
commonly used patterns are pushed out, if that is really the case,
perhaps a better solution is to make history items sticky or extend the
list of kept globs.
Jacob Carlborg
2018-11-10 19:55:05 UTC
Permalink
It sounds like you would like to define what * means so you can type * as shorthand for a predefined glob.
Yes, exactly.
I think this is what is normally handled with history, which TextMate already supports.
I use history for find globs a lot myself, and have not found that commonly used patterns are pushed out, if that is really the case, perhaps a better solution is to make history items sticky or extend the list of kept globs.
I think it’s faster for me to just type “*” then to look for something in the history. But if there was a separate UI element that would get me this glob pattern, that would also work.

--
/Jacob Carlborg

Loading...