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

Re: help for a function and its completion



ugaciaka wrote:
> ok thank's,
> But I have a problem, do not use a file containing the functions. I
> copied everything. zshrc renaming cm in _cm but when source .zshrc
> 
> expl=''
> _tags:comptags:36: can only be called from completion function
> _tags:comptry:55: can only be called from completion function
> _tags:comptags:60: can only be called from completion function
> _tags:comptags:67: can only be called from completion function
> 
> how can I solve? thanks

The function I sent needs to be inside a special file in your function
path, given by the $fpath variable.  If you don't have such a directory,
create one, for example "mkdir ~/zsh-function".  Then  in your .zshrc
(at some point before "compinit" is run) put

fpath=(~/zsh-functions $fpath)

Then put the contents of the function in a file _cm in that directory.
You should be able to do:

% cat ~/zsh-functions/_cm
#compdef cm ex
... rest of file ...

Then the next time you start the shell completion for "cm" and "ex" will
work.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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