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

Re: Can someone help me convert compctl to zstyle, please.



On Tue, Feb 05, 2002 at 10:02:09AM +0000, Oliver Kiddle wrote:
> Have you at least run compinit? (You need autoload -U compinit;compinit
> in your .zshrc or run compinstall similarly from the command line). 

Yes, I had.
 
> There is already a pre-written completion for sysctl so this should

I haven't got anything in my /usr/local/share/zsh/4.0.2/functions with
sysctl mentioned in it. I'll update to 4.0.4.

> already work. If it didn't, you could do:
> 
>   _sysctl {
>     compadd $(sysctl -AN ${1%.*})
>   }
>   compdef _sysctl sysctl

Sorry for the incredibly dumb-sounding question, but *where* would I do
that? I tested this it on the command line and in my ~/.zprofile, and
zsh sulked. If I changed the first line to "_sysctl () {" (tested on the
command line only, not that that should make a difference), then it
accepts it happily, but fails when I try to use it.
 
> Here you need something like:
>   zstyle ':completion:*:*:(ssh|scp):*:my-accounts' users-hosts \
>     root@xxxxxxxxxxxxxxxxxx root@xxxxxxxxxxxxxxxxx

Hm. Not quite the same as I had before, but close enough. I had got used
to a single tab though. Hrm. Is there a way to remove the /etc/hosts
from the lists of hostnames to try. I'm guessing it's something to do
with the tag-order thing, but, uhm, again, it appears not to like me.

> Peter has written a user-guide which has a good chapter on the new
> completion system. You might find it easier than the manual. It is
> available at http://zsh.sunsite.dk/Guide/zshguide.html

Alas I was reading that yesterday too. I think I'm missing something
fundamental. When I work out what that is, I'm sure it will all make
sense.

-- 
PGP Key: D2729A3F - Keyserver: wwwkeys.uk.pgp.net - rich at rdrose dot org
Key fingerprint = 5EB1 4C63 9FAD D87B 854C  3DED 1408 ED77 D272 9A3F
Public key also encoded with outguess on http://rikrose.net



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