From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2195 invoked from network); 17 Sep 2003 07:28:34 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 17 Sep 2003 07:28:34 -0000 Received: (qmail 15047 invoked by alias); 17 Sep 2003 07:28:23 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6588 Received: (qmail 15036 invoked from network); 17 Sep 2003 07:28:22 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 17 Sep 2003 07:28:22 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.211] by sunsite.dk (MessageWall 1.0.8) with SMTP; 17 Sep 2003 7:28:22 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-11.tower-36.messagelabs.com!1063783701!596957 X-StarScan-Version: 5.0.7; banners=-,-,- Received: (qmail 1072 invoked from network); 17 Sep 2003 07:28:21 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-11.tower-36.messagelabs.com with SMTP; 17 Sep 2003 07:28:21 -0000 Received: from gmcs3.local ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id h8H7SKtW007747 for ; Wed, 17 Sep 2003 08:28:20 +0100 Received: from gmcs3.local (localhost [127.0.0.1]) by gmcs3.local (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h8H7Udb17944 for ; Wed, 17 Sep 2003 09:30:40 +0200 To: Zsh-users List X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <1030916170354.ZM30176@candle.brasslantern.com> From: Oliver Kiddle References: <20030914103053.GA827@strindberg.student.uu.se> <1030914185817.ZM27558@candle.brasslantern.com> <20030915190817.GA582@strindberg.student.uu.se> <1030916170354.ZM30176@candle.brasslantern.com> Subject: Re: Case-insensitive completion Date: Wed, 17 Sep 2003 09:30:39 +0200 Message-ID: <17942.1063783839@gmcs3.local> 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