Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Ssh completion from ~/.ssh/config
- X-seq: zsh-users 20111
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx, zsh-users@xxxxxxx
- Subject: Re: Ssh completion from ~/.ssh/config
- Date: Wed, 8 Apr 2015 09:47:26 -0700
- In-reply-to: <CABZhJg_R=a+TeSTjf51CqP6yhDZpTtKxjmbwkzqVRD97Li4q+g@mail.gmail.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>
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