From: John Benninghoff <john.benninghoff@gmail.com>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: zsh-users@zsh.org
Subject: Re: ssh host completion
Date: Sat, 24 Mar 2018 21:05:47 -0700 [thread overview]
Message-ID: <CAOYnHSZUEeEqLQeC8nHzYFWEm2D5OveevgVeHqe-OR99jjuhOg@mail.gmail.com> (raw)
In-Reply-To: <25763.1521678403@thecus>
[-- Attachment #1: Type: text/plain, Size: 1392 bytes --]
Thanks, the first context suggestion worked.
/John
On Wed, Mar 21, 2018 at 5:26 PM, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
> 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-25 4:05 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
2018-03-25 4:05 ` John Benninghoff [this message]
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=CAOYnHSZUEeEqLQeC8nHzYFWEm2D5OveevgVeHqe-OR99jjuhOg@mail.gmail.com \
--to=john.benninghoff@gmail.com \
--cc=okiddle@yahoo.co.uk \
--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).