How can I make zsh auto-completion give me case-insensitive matches if I typed lowercase, but case-sensitive ones if I typed uppercase? For example, if I type "HOtab" it should offer HOME
and HOST
, but if I type "hotab" it should offer HOME
, HOST
, host
, hostinfo
, and hostname
.
The case-insensitive part is easy (matcher-list m:{a-zA-Z}={A-Za-z}
), and I found Have zsh return case-insensitive auto-complete matches, but prefer exact matches, but that's not quite what I want — if there are any exact lowercase matches, it will not offer the uppercase ones. I suspect the answer has to do with a left-anchored matcher, but I can't get it to work.