Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ssh scp completion
- X-seq: zsh-users 7701
- From: Laurent Rineau <rineau@xxxxxxxxxxxxxx>
- To: zsh-users <zsh-users@xxxxxxxxxx>
- Subject: Re: ssh scp completion
- Date: Fri, 16 Jul 2004 17:05:48 +0200
- In-reply-to: <20040716094047.GA18775@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040716094047.GA18775@xxxxxxxxxxxxxxxxxxxxxx>
On Fri, Jul 16, 2004 at 11:40:47AM +0200, Martin Marcher wrote:
> from the ~/.ssh/config file syntax is:
>
> Host foo
> .
> .
>
> Host bar
> .
> .
>
> Host *
> general options
>
>
> now i want to only have the following completions: 'foo' and 'bar' the
> manpages are way to big for me to find what I want, especially that i
> don't really have an idea what sections i should have a look at.
You can set up directly the style hosts:
zstyle ':completion:*:*:*' hosts foo bar
or use something like what I have in my .zshrc:
[ -f ~/.ssh/config ] && : ${(A)ssh_config_hosts:=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}}
[ -f ~/.ssh/known_hosts ] && : ${(A)ssh_known_hosts:=${${${(f)"$(<$HOME/.ssh/known_hosts)"}%%\ *}%%,*}}
zstyle ':completion:*:*:*' hosts $ssh_config_hosts $ssh_known_hosts
Remove $ssh_known_hosts if you do not want to add the content of
.ssh/known_hosts
Messages sorted by:
Reverse Date,
Date,
Thread,
Author