Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Ssh completion from ~/.ssh/config
- X-seq: zsh-users 20112
- From: Jesper Nygårds <jesper.nygards@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Ssh completion from ~/.ssh/config
- Date: Wed, 8 Apr 2015 19:59:38 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=zqgAtpHOAZqQZHP9a5TeXh37Y6SN7o3h7OcYnGWHSIQ=; b=DVeJTlHj9msGbgKxD3dhgfj9YZT7NKYSpoVvsP4Ty4cdXgR9zCHjfTGfqaBLz9rAlR vMJKltYSexHdUdw2oPhp7rNo7JcN8nUOkEsW4tEQFqShLWL1/e+LMnnSXlht0bZoYrCn QIkAT/YrsWP6qBjC+2698IcjhzERZi+iFBVNLs+EhcQFcWVaJEe9yfq7R0OutRIBL4z1 l0FrBBtVK8Rw5slNE1kFcVTBMW8iYANm2sLbpDqLD6XRN3kQIgGUhZt2ggtKDbMdLUsZ p3ZiRDIBnBLw9pNm+o8KDwA7Q8Ugl+UuPTqgTtF1IdmKAUGY6fPFtFkFAd7BUktKaEOf C9dA==
- In-reply-to: <150408094726.ZM23641@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CABZhJg-8fQyOsYLHwYKoDx8DxOsReeZzfhtoi5fV_DDUQ-ziZA@mail.gmail.com> <1797284.9M4pHoONQN@note> <CABZhJg_R=a+TeSTjf51CqP6yhDZpTtKxjmbwkzqVRD97Li4q+g@mail.gmail.com> <150408094726.ZM23641@torch.brasslantern.com>
Thank you Bart, that works perfectly!
On Wed, Apr 8, 2015 at 6:47 PM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
wrote:
> On Apr 7, 8:37pm, Jesper Nygards wrote:
> }
> } However, the existing _ssh file already has working code for parsing the
> } .ssh/config file. Code which is far more readable, and doesn't require me
> } to parse it myself with that hosts definition. For some reason though,
> } someone has decided that it is not to be used. I would still prefer it if
> } there was some way of configuring that I want to use the code that is
> } already written, and that I prefer .ssh/config over .ssh/known_hosts.
>
> Try this:
>
> zstyle -e ':completion:*:*:ssh:*:my-accounts' users-hosts \
> '[[ -f ~/.ssh/config && $key = hosts ]] && key=my_hosts reply=()'
>
> You can then either define the function _my_hosts which will be called to
> add the host completions, or _ssh_hosts will fall through to the code that
> reads the .ssh/config files.
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author