Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion with a PATH assignment
- X-seq: zsh-users 9663
 
- From: Peter Stephenson <pws@xxxxxxx>
 
- To: zsh-users@xxxxxxxxxx
 
- Subject: Re: completion with a PATH assignment
 
- Date: Mon, 07 Nov 2005 11:15:10 +0000
 
- In-reply-to: <20051107110017.GF2774@xxxxxxxx> 
 
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
 
- References: <tkrat.082d2d140cff4d6c@xxxxxxxxxxxxxxxxxxx> <EXCHANGE03dCRVFqBDf00009f90@xxxxxxxxxxxxxxxxxx> <20051107103925.GE2774@xxxxxxxx> <EXCHANGE03tPlcoQsIl00009fac@xxxxxxxxxxxxxxxxxx> <20051107110017.GF2774@xxxxxxxx>
 
Sebastian Stein wrote:
> So this means that even thus just the completion of a filename is needed,
> this must especially coded for each supported command like svn?
Yes, essentially:  the context has to invoke _files, which doesn't
involve much coding but must be done explicitly.
> Shouldn't there be some kind of fallback? I mean if zsh is not able to
> expand it,  maybe it should just try filenames in the current
> directory instead?
In principle it should be able to expand it; it's a bug that it can't.
It's easy to get plain old file completion bound to a separate key.
Given that the contextual completion is already complicated, this tends
to make more sense than yet more guessing.  For example, if you bind
_bash_completions to Esc / you get file name completion.  Or you can
create a widget:
  zstyle ':completion:plain-old-file-completion:*' completer _files
  zle -C plain-old-file-completion complete-word _generic
  bindkey '^xf' plain-old-file-completion
Or if you really always want file completion as a fallback, you can add
_files to the default completer list.  For example,
  zstyle ':completion:*' completer _oldlist _expand _complete _ignored \
  _approximate _files
-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070
This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author