Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: help for a function and its completion
- X-seq: zsh-users 13948
- From: Peter Stephenson <pws@xxxxxxx>
- To: ugaciaka <ugaciaka@xxxxxxxxx>, zsh-users@xxxxxxxxxx
- Subject: Re: help for a function and its completion
- Date: Fri, 20 Mar 2009 09:51:14 +0000
- In-reply-to: <e7db6e960903200134r7c96bf0cy862c2069404230ea@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <e7db6e960903191458g1986e80ag7452db9e59d07469@xxxxxxxxxxxxxx> <20090319234848.4eca9a7d@pws-pc> <e7db6e960903200134r7c96bf0cy862c2069404230ea@xxxxxxxxxxxxxx>
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