Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion tricks
- X-seq: zsh-users 3692
- From: Adam Spiers <adam@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: completion tricks
- Date: Mon, 19 Mar 2001 21:30:06 +0000
- In-reply-to: <20010319141533.D94071@xxxxxxxxxx>; from marius@xxxxxxxxxx on Mon, Mar 19, 2001 at 02:15:33PM -0600
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <Pine.LNX.4.31.0103191314040.4850-100000@neptune> <20010319141533.D94071@xxxxxxxxxx>
- Reply-to: Adam Spiers <adam@xxxxxxxxxx>
Marius Strom (marius@xxxxxxxxxx) wrote:
> On Mon, Mar 19, 2001 at 01:14:54PM -0700, Jeff Shipman wrote:
> > I was wondering how to set up some completion tricks like
> > these:
> >
> > 1) Using 'man' will complete different man pages
> >
> > 2) Using ssh, rlogin, telnet, etc will complete
> > different hosts on my network.
>
> Jeff,
> I did the second portion as thus in my .zshrc:
>
> hosts=( host1 host2 host3.fqdn.com )
> compctl -k hosts ssh ftp telnet ping traceroute mtr rlogin rsh
Or if you're using a development version (highly recommended), forget
compctl altogether, and do `autoload compinstall; compinstall' to
install the new completion system, which is much better.
Completion of man pages should then work automatically. You can
also configure ssh etc. like so:
# All my accounts:
my_accounts=(
{joe,root}@mymachine.com
jbloggs@xxxxxxxxxxxxxxxxxx
)
# Other people's accounts:
other_accounts=(
{fred,root}@hismachine.com
vera@xxxxxxxxxxxxxx
)
zstyle ':completion:*:my-accounts' users-hosts $my_accounts
zstyle ':completion:*:other-accounts' users-hosts $other_accounts
telnet_users_hosts_ports=(
user1@host1:
user2@host2:
@mail-server:{smtp,pop3}
@news-server:nntp
@proxy-server:8000
)
zstyle ':completion:*:*:telnet:*' users-hosts-ports $telnet_users_hosts_ports
Note to zsh-workers: it looks like completion within the -l option of
telnet is broken.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author