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

Re: generic filename completion like "foo --file=ba<tab>"



Will Yardley wrote:
> i still don't really understand... is there a way to use parts of the
> new completion system without loading the whole shebang? believe it or
> not, there are certain things that i _don't_ want to complete (or that i
> like doing my own way)... is there a way to load only specific functions
> from the new system?

You could exclude the functions you don't want from your path.  This
obviously needs some reorganising of $fpath or the directories, but for
example, if you have the functions installed in hierarchical directories,
you could remove
/usr/local/share/zsh/4.0.2/functions/Completion/Unix/Command
from $fpath, link any commands you do want completion for into a
different directory, and add that to your path.

You could also post-process the associative array $_comps after loading the
completion system.  This gives the functions to be used for a given
context, typically a command name, e.g. ${_comps[dd]} is _dd.  You can
unset elements you don't want completion for.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************



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