Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: Matching against file suffix



>
> The simple 'r:|.=* r:|=*' works for me, i.e. `foo .../.texi<TAB>'
> gives me the *.texi files.
>

Well, I never could completely grok matchers :-)

Still, it seems, that with above matcher zsh considers only first dot. E.g.

zstyle ':completion:*:*:files' matcher 'r:|.=* r:|=*'
bor@itsrm2% l
WinNT/                    patches/                  zsh-3.1.6-dev-15.tar.gz
zsh-3.1.6-dev-16.tar.gz   zsh-3.1.6-dev-17.tar.gz   zsh-3.1.6-dev-18.tar.gz
zsh-3.1.6-dev-19.tar.gz   zsh-3.1.6.tar.gz
bor@itsrm2% l .gz<TAB>
	beeps, but
bor@itsrm2% l .1<TAB>
bor@itsrm2% l zsh-3.1.6.tar.gz
Completing file
zsh-3.1.6-dev-15.tar.gz   zsh-3.1.6-dev-16.tar.gz   zsh-3.1.6-dev-17.tar.gz
zsh-3.1.6-dev-18.tar.gz   zsh-3.1.6-dev-19.tar.gz   zsh-3.1.6.tar.gz

I vaguelly remember, that it was once done on purpose. While I agree, that it may be
useful at times - is it possible to have alternate way that matches separators as well? Or
some other way to get the above?

In the above case I'd like being able to say

gzcat -19TAB (or even -6-19)
and get it expanded to zsh-3.1.6-dev-19.tar.gz


> Btw, I have the _match completer in my completer style, but only after
> all the matcher-list specs have been tried (which include the one
> above and the substring-matcher `l:|=* r:|=*').
>


That reminds me. Matcher-list is way too general - it applies to any completion in any
context. And matcher is tried unconditionally, isn't it? Is there any feasible way to add
per-tag matcher-list? So, that one could say

*files matcher-list ...

-andrej



Messages sorted by: Reverse Date, Date, Thread, Author