From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: John Benninghoff <john.benninghoff@gmail.com>
Cc: zsh-users@zsh.org
Subject: Re: ssh host completion
Date: Thu, 22 Mar 2018 01:26:43 +0100 [thread overview]
Message-ID: <25763.1521678403@thecus> (raw)
In-Reply-To: <CAOYnHSbb_x5aN-A+9apGdX3kd0eEZiifGPH9jndUuuBLMEYeCA@mail.gmail.com>
On 27 Feb, John Benninghoff wrote:
> the host names configured in my ~/.ssh/config file. I use the following
> section in my .zshrc file to try to get the desired behavior:
>
> if [[ -r ~/.ssh/config ]]; then
> sconf=( $(sed -n '/^Host[=\t ]/{s///;s/#.*//;p;}' ~/.ssh/config) )
> zstyle ':completion::complete:ssh:argument-1:' tag-order !users
> zstyle ':completion::*:ssh:*:' hosts $sconf
I think the context for this zstyle won't match. Try something like:
zstyle ':completion::*:ssh:*:hosts' hosts $sconf
or perhaps just:
zstyle ':completion::*:ssh:*' hosts $sconf
If that doesn't help, try experimenting with the users-hosts style. That
needs a context like ':completion:*:ssh:*:my-accounts'. It also expects
usernames in the style values.
> # Use ^Xh to see context and tags applicable in CLI position
Also useful is ^X? to do a full trace. If you view the trace with less,
filtering it with & can be very useful.
> :completion::complete:ssh:argument-1: !users
A similar but slightly different option is to just hide the users:
zstyle ':completion:*:ssh:*:users' hidden true
Sorry that your message didn't get answered sooner.
Oliver
next prev parent reply other threads:[~2018-03-22 0:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-28 2:13 John Benninghoff
2018-03-22 0:26 ` Oliver Kiddle [this message]
2018-03-25 4:05 ` John Benninghoff
2018-03-25 5:18 ` Vadim A. Misbakh-Soloviov
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=25763.1521678403@thecus \
--to=okiddle@yahoo.co.uk \
--cc=john.benninghoff@gmail.com \
--cc=zsh-users@zsh.org \
/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).