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

Re: Case-insensitive completion

On 14 Sep, Jesper Holmberg wrote:
> As I interpret the manual, the following lines:
> zstyle ':completion:*' completer _expand _complete _complete:jhcase _ignored
> zstyle ':completion:*:jhcase:*' matcher-list 'm:{a-z}={A-Z}'
> would achieve what I want. However, now typing "cd ni<tab>" gives me only
> "nik", and apparently "Nic" no longer matches. I suppose my jhcase-completion
> completer is never called.

Here's another idea on how to do this. It's no better than Bart's
suggestion but might be closer to what you want to do. It's not specific
to filename completion and it still suffers the problem that matches
that don't need the matching control get added twice. Not compatible
with using a group-name style of '' to use the tag name but I'm supposing
that for pure menu-completion you might not care about that anyway.

_cscomplete() {
  return 1
zstyle ':completion:*:cscomplete:*' group-name case-sensitive
zstyle ':completion:*:complete:*' group-name case-insensitive
zstyle ':completion:*' group-order case-sensitive case-insensitive
zstyle ':completion:*::::' completer _cscomplete _complete
zstyle ':completion:*:cscomplete:*:*' matcher-list ''
zstyle ':completion:*:complete:*' matcher-list 'm:{a-z}={A-Z}'

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