bfs
bfs copied to clipboard
Feature request: highlight matched part of filename
I think it would help with readability if matched substrings were highlighted in some way (eg: with a yellow background).
It would be extra helpful for regular expressions, where the patterns are abstract.
A workaround is to run bfs | grep --color
, but this removes all of bfs' beautiful filetype colour coding!
Hmm, I like this idea, but there are a couple complications:
-
Technically, the matched part is either the whole filename or the whole path. That is, with
-name '*foo*'
, the pattern*foo*
matches the entirety of the filename. Similarly, for-regex '.*foo.*'
, the regex matches the entire path. I suppose the most helpful thing is to ignore any leading/trailing wildcards (or, for regexes, maybe use the first capture group?). -
For more complicated expressions, it may not be clear what the matched part was. For example,
-name 'foo*' -a -name '*bar' -o -name '*baz*'
. But the simplest cases (just-name 'blah'
) can be handled.
Oh, I see. That is problematic.
That also explains why -regex substring
didn't match anything.
Could there maybe be an extra mode, or matcher, that's designed more for the use-case of "finding a file"? Something more along the lines of grep? (bfs -grep
?)