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

Re: complete all "cvs add" matches



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

Oliver


This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.



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