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

Re: completion with a PATH assignment

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