zsh-users
 help / color / mirror / code / Atom feed
From: Louis-David Mitterrand <vindex@apartia.org>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: zsh users <zsh-users@sunsite.dk>
Subject: Re: complete all "cvs add" matches
Date: Mon, 21 Oct 2002 16:45:46 +0200	[thread overview]
Message-ID: <20021021144546.GA4774@apartia.org> (raw)
In-Reply-To: <E183dWs-0002Hz-00@bimbo.logica.co.uk>

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 <TAB>
> > 
> > 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
> > <TAB> 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)


  reply	other threads:[~2002-10-21 14:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-21 13:42 Louis-David Mitterrand
2002-10-21 14:27 ` Oliver Kiddle
2002-10-21 14:45   ` Louis-David Mitterrand [this message]
2002-10-21 15:00 ` Bart Schaefer
2002-10-21 15:04   ` Roman Neuhauser
2002-10-21 15:22     ` Bart Schaefer
2002-10-22  2:34   ` John Buttery
2002-10-22 15:43     ` Off-topic not really " Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021021144546.GA4774@apartia.org \
    --to=vindex@apartia.org \
    --cc=okiddle@yahoo.co.uk \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).