zsh-users
 help / color / mirror / code / Atom feed
From: "Oliver Kiddle" <okiddle@yahoo.co.uk>
To: Rik <rik@pkl.net>
Cc: zsh-users@sunsite.dk
Subject: Re: Can someone help me convert compctl to zstyle, please.
Date: Tue, 5 Feb 2002 10:02:09 +0000 (GMT)	[thread overview]
Message-ID: <20020205100209.37738.qmail@web9305.mail.yahoo.com> (raw)
In-Reply-To: <20020205031811.GA29284@spoon.pkl.net>

 --- Rik <rik@pkl.net> wrote: > Hello everyone,
> 
> I'm having problems with zstyle. TO be perfectly honest, I've not
> managed to actually get it to do anthing, which means I have missed
> something.

Have you at least run compinit? (You need autoload -U compinit;compinit
in your .zshrc or run compinstall similarly from the command line). 

> I used to use:
> listsysctls () { set -A reply $(sysctl -AN ${1%.*}) }
> compctl -K listsysctls sysctl

There is already a pre-written completion for sysctl so this should
already work. If it didn't, you could do:

  _sysctl {
    compadd $(sysctl -AN ${1%.*})
  }
  compdef _sysctl sysctl

> ssh_common=( {,root@}mail.mynetwork.com {,root@}www.mynetwork.com )
> compctl -K ssh_common ssh scp

Here you need something like:
  zstyle ':completion:*:*:(ssh|scp):*:my-accounts' users-hosts \
    root@mail.mynetwork.com root@www.mynetwork.com

Again a completion for ssh has already been written so all the options
should be working. It looks up this style to find out your ssh
accounts.
 
> My basic problem is that an hour of staring at the man page, even
> with
> examples, has not helped in the slightest.

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

Oliver

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


  reply	other threads:[~2002-02-05 10:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-05  3:18 Rik
2002-02-05 10:02 ` Oliver Kiddle [this message]
2002-02-05 10:38   ` Rik
2002-02-05 11:26     ` Oliver Kiddle
2002-02-05 15:12       ` Rik
2002-02-12 17:07         ` Reading .zprofile (Re: Can someone help me convert ...) Bart Schaefer
2002-02-12 21:25           ` Craig Van Tassle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020205100209.37738.qmail@web9305.mail.yahoo.com \
    --to=okiddle@yahoo.co.uk \
    --cc=rik@pkl.net \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).