From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29719 invoked from network); 21 Oct 2002 14:47:42 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 21 Oct 2002 14:47:42 -0000 Received: (qmail 17388 invoked by alias); 21 Oct 2002 14:47:10 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5448 Received: (qmail 17357 invoked from network); 21 Oct 2002 14:47:08 -0000 Date: Mon, 21 Oct 2002 16:45:46 +0200 From: Louis-David Mitterrand To: Oliver Kiddle Cc: zsh users Subject: Re: complete all "cvs add" matches Message-ID: <20021021144546.GA4774@apartia.org> Mail-Followup-To: Oliver Kiddle , zsh users References: <20021021134213.GA3967@apartia.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4i On Mon, Oct 21, 2002 at 03:27:38PM +0100, Oliver Kiddle wrote: > On 21 Oct, you wrote: > > > > Let's say I have 3 files in a cvs repository that I want to "cvs add", > > so I type: > > > > % cvs add > > > > Since I have activated cvs completion, zsh offers to "add" only these 3 > > files, which appear under my command line. > > > > How can I get these 3 file names on the command line? Right now I press > > again to insert the first match and have to "cvs add" once for > > each file. > > This can be done by adding > compstate[insert]=all > to the end of _cvs_add. I'm not keen on doing this in the distributed > _cvs but you could use your own replacement _cvs_add function. > > I don't remember there being a style to do this, perhaps there should > be one. > > You might also want to have a look at the _all_matches completer. Don't > be tempted to try to bind the _all_matches completer to the specific > context of cvs-add with zstyle though because completers are determined > long before the context is elaborated to that level of detail and it > won't work. Personally, I bind a key to it which I can use in situations > such as this. The necessary lines from my .zshrc being these: > > bindkey '^Xx' all-matches > zstyle ':completion:all-matches::::' completer _all_matches _complete > zstyle ':completion:all-matches:*' old-matches true > zstyle ':completion:all-matches:*' insert true > zle -C all-matches complete-word _generic This works beautifully, thanks a lot! -- ARICIE: De votre injuste haine il n'a pas hérité ; Il ne me traitait point comme une criminelle. (Phèdre, J-B Racine, acte 5, scène 3)