zsh-users
 help / color / mirror / code / Atom feed
From: Laurent Rineau <rineau@clipper.ens.fr>
To: zsh-users <zsh-users@sunsite.dk>
Subject: Re: ssh scp completion
Date: Fri, 16 Jul 2004 17:05:48 +0200	[thread overview]
Message-ID: <20040716150547.GA9564@clipper.ens.fr> (raw)
In-Reply-To: <20040716094047.GA18775@xover.htu.tuwien.ac.at>

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


      reply	other threads:[~2004-07-16 15:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-16  9:40 Martin Marcher
2004-07-16 15:05 ` Laurent Rineau [this message]

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=20040716150547.GA9564@clipper.ens.fr \
    --to=rineau@clipper.ens.fr \
    --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).