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

Re: Case-insensitive completion



* On Sun Sep 14, Bart Schaefer wrote:
> On Sep 14, 12:30pm, Jesper Holmberg wrote:
> Completers are called in order until one of them succeeds.  Because the
> _complete call found "nik", _complete:jhcase was never called.

Thank you for your reply, Bart. I thought that all the completers were
called, each appending to the previous list. I realize now that what I'm
trying to achieve is quite difficult with the way it really works. I'll
have a try with your suggested solution.

However, perhaps I better state my original problem here, instead of
trying to solve it with the wrong solution.

I have been using case-insensitive completion of file names for a while
now, with the generic:

zstyle ':completion:*' matcher-list 'm:{a-zåäö}={A-ZÅÄÖ}'

This works well, but - as is the essence of case-insensitivity - one loses
some precision in specifying ones needs: it is difficult to express that
in this particular instance I want to really match with case sensitivity.

Say for example I have the following files:

aac.txt aAa.txt Aaa.txt aAb.txt

If I want to complete for "Aaa.txt", it works well, I just put capital "A"
and hit tab, and since the matching is only one-way, the completer knows
that I really want a capital A, and gives me Aaa.txt.

If, on the other hand, I wanted aac.txt, hitting "aa" would not really
help me, since "aAa.txt", "Aaa.txt" and "aAb.txt" would all be proposed
before my aac.txt. I am thus looking for an easy way to specify that 
*this time* I really want to match on literally "aa".

Perhaps what I want is unachievable, but has anyone solved this in a smart
way?

TIA,

Jesper



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