* ssh scp completion
@ 2004-07-16 9:40 Martin Marcher
2004-07-16 15:05 ` Laurent Rineau
0 siblings, 1 reply; 2+ messages in thread
From: Martin Marcher @ 2004-07-16 9:40 UTC (permalink / raw)
To: zsh-users
[-- Attachment #1: Type: text/plain, Size: 516 bytes --]
Hi,
I'm trying to configure a completion so that ssh and scp get the
following completion behavior:
from the ~/.ssh/config file syntax is:
Host foo
moreconfig options
even more
.
.
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.
any help appreciated
thx
Martin
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: ssh scp completion
2004-07-16 9:40 ssh scp completion Martin Marcher
@ 2004-07-16 15:05 ` Laurent Rineau
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Rineau @ 2004-07-16 15:05 UTC (permalink / raw)
To: zsh-users
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-07-16 15:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-16 9:40 ssh scp completion Martin Marcher
2004-07-16 15:05 ` Laurent Rineau
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).