Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Case-insensitive completion
- X-seq: zsh-users 6588
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh-users List <zsh-users@xxxxxxxxxx>
- Subject: Re: Case-insensitive completion
- Date: Wed, 17 Sep 2003 09:30:39 +0200
- In-reply-to: <1030916170354.ZM30176@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20030914103053.GA827@xxxxxxxxxxxxxxxxxxxxxxxx> <1030914185817.ZM27558@xxxxxxxxxxxxxxxxxxxxxxx> <20030915190817.GA582@xxxxxxxxxxxxxxxxxxxxxxxx> <1030916170354.ZM30176@xxxxxxxxxxxxxxxxxxxxxxx>
Bart wrote:
> Normally the way to do that would be to use different keybindings for
> "complete case-insensitively" vs. "complete case-sensitively" and tell
> zsh your preference by which of them you invoke.
>
> Start with zstyles something like this:
>
> zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
> zstyle ':completion:*:case-sensitive:*' matcher-list ''
> zstyle ':completion:*' completer _expand _complete _ignored
>
> Then, in a file (name doesn't matter much) somewhere in the path where
> compinit looks for completion functions, you put:
>
> ---- 8< ---- snip ---- 8< ----
> #compdef -k complete-word \C-xI
> _main_complete _expand _complete:case-sensitive _ignored
> ---- 8< ---- snip ---- 8< ----
Would always use _generic for that type of thing myself. Avoids the need
for a separate function file:
zle -C case-sensitive complete-word _generic
zstyle ':completion:case-sensitive::::' completer _expand _complete _ignored
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
zstyle ':completion:case-sensitive:*' matcher-list ''
bindkey '^XI' case-sensitive
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author