zsh-users
 help / color / mirror / code / Atom feed
* 2 newbie ?s
@ 2001-06-06 21:03 David Thiel
       [not found] ` <3B1E9F91.5228C985@cohesive.net>
  2001-06-07 17:22 ` Bart Schaefer
  0 siblings, 2 replies; 7+ messages in thread
From: David Thiel @ 2001-06-06 21:03 UTC (permalink / raw)
  To: zsh-users

Hi all,

I'm giving zsh a try after using tcsh for most of my life, and I'm having a
pretty good time with it so far.  2 things - how would I make it so I could
type in ssh dthiel@red (tab) and have it complete to ssh
dthiel@redundancy.redundancy.org, or if I type in ping deepthought.red (tab)
and have it complete in the same way?  Also, does anyone know how to get the
mailchecking functional with Maildir format mailboxes?

Thanks much,
David



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2 newbie ?s
       [not found] ` <3B1E9F91.5228C985@cohesive.net>
@ 2001-06-06 23:02   ` David Thiel
  2001-06-07  0:26     ` Alan Third
  0 siblings, 1 reply; 7+ messages in thread
From: David Thiel @ 2001-06-06 23:02 UTC (permalink / raw)
  To: Thomas W. Holt Jr.; +Cc: zsh-users

Yeah, I have something similar, but it won't complete the hostname if you
have something directly before it, like dthiel@blablabla.com.  If you just
ping bla(tab), it'll work.  That's what I'm trying to figure out.

Thanks,
David

----- Original Message -----
From: "Thomas W. Holt Jr." <twh@cohesive.net>
To: "David Thiel" <dthiel@nexprise.com>
Sent: Wednesday, June 06, 2001 2:24 PM
Subject: Re: 2 newbie ?s


>
> I used to do it with the compctl stuff and the hosts environment variable,
but
> I just upgraded zsh on my main box and dumped all my compctl rules...
>
> still have my hosts varible set in my .zshrc with
>
> # Filename suffixes to ignore during completion
> fignore=(.o .c~ .old .pro .bak)
> # Hosts to use for completion
> hosts=(`hostname` $(cat ~/.hosts))
>
> then I just did a
>
> autoload -U compinit; compinit
>
> Adding that to my .zshrc now
>
> Now I can ping hostname<tab> and it'll finish
>
> I'm not too up to par on the new compinit stuff yet though, it seems to
> work fine so far.
>
>
> David Thiel wrote:
> >
> > Hi all,
> >
> > I'm giving zsh a try after using tcsh for most of my life, and I'm
having a
> > pretty good time with it so far.  2 things - how would I make it so I
could
> > type in ssh dthiel@red (tab) and have it complete to ssh
> > dthiel@redundancy.redundancy.org, or if I type in ping deepthought.red
(tab)
> > and have it complete in the same way?  Also, does anyone know how to get
the
> > mailchecking functional with Maildir format mailboxes?
> >
> > Thanks much,
> > David


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2 newbie ?s
  2001-06-06 23:02   ` David Thiel
@ 2001-06-07  0:26     ` Alan Third
  2001-06-07  0:34       ` Mads Martin Jørgensen
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Third @ 2001-06-07  0:26 UTC (permalink / raw)
  To: zsh-users

On Wed, Jun 06, 2001 at 04:02:31PM -0700, David Thiel wrote:
> Yeah, I have something similar, but it won't complete the hostname if you
> have something directly before it, like dthiel@blablabla.com.  If you just
> ping bla(tab), it'll work.  That's what I'm trying to figure out.

I use:

zstyle ':completion:*:hosts' hosts $hosts

Where $hosts holds the list of hostnames I want to use.
That seems to work perfectly with ssh alan@os<tab> and suchlike.
-- 
Alan Third

Put your head in the microwave and give yourself a tan


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2 newbie ?s
  2001-06-07  0:26     ` Alan Third
@ 2001-06-07  0:34       ` Mads Martin Jørgensen
  2001-06-07 16:33         ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Mads Martin Jørgensen @ 2001-06-07  0:34 UTC (permalink / raw)
  To: Alan Third, zsh-users

* Alan Third <alan@idiocy.org> [Jun 06. 2001 17:26]:
> On Wed, Jun 06, 2001 at 04:02:31PM -0700, David Thiel wrote:
> > Yeah, I have something similar, but it won't complete the hostname if you
> > have something directly before it, like dthiel@blablabla.com.  If you just
> > ping bla(tab), it'll work.  That's what I'm trying to figure out.
> 
> I use:
> 
> zstyle ':completion:*:hosts' hosts $hosts
> 
> Where $hosts holds the list of hostnames I want to use.
> That seems to work perfectly with ssh alan@os<tab> and suchlike.

Or how about this one:

zstyle -e ':completion:*:ssh:*' hosts 'reply=($(sed -e "/^#/d" -e "s/
.*\$//" -e "s/,/ /g" /etc/ssh_known_hosts ~/.ssh/known_hosts
~/.ssh/known_hosts2 2>/dev/null))'

-- 
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic and
totally illogic, with just a little bit more effort."
                                -- A. P. J.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2 newbie ?s
  2001-06-07  0:34       ` Mads Martin Jørgensen
@ 2001-06-07 16:33         ` Bart Schaefer
       [not found]           ` <20010607144618.A18221@dman.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2001-06-07 16:33 UTC (permalink / raw)
  To: zsh-users

On Jun 6,  5:34pm, Mads Martin Jørgensen wrote:
} Subject: Re: 2 newbie ?s
}
} zstyle -e ':completion:*:ssh:*' hosts 'reply=($(sed -e "/^#/d" -e "s/
} .*\$//" -e "s/,/ /g" /etc/ssh_known_hosts ~/.ssh/known_hosts
} ~/.ssh/known_hosts2 2>/dev/null))'
 
} "Why make things difficult, when it is possible to make them cryptic and
} totally illogic, with just a little bit more effort."
}                                 -- A. P. J.

In that spirit:

    zstyle -e ':completion:*:ssh:*' hosts 'reply=(
	${=${${(f)"$(cat {/etc/,{/etc/ssh_,~/.ssh/}known_}hosts(|2)(N) \
			 <<(ypcat hosts 2>/dev/null))"}%%[# ]*}//,/ }
	)'

That might actually be a bit *too* thorough ...

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2 newbie ?s
  2001-06-06 21:03 2 newbie ?s David Thiel
       [not found] ` <3B1E9F91.5228C985@cohesive.net>
@ 2001-06-07 17:22 ` Bart Schaefer
  1 sibling, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2001-06-07 17:22 UTC (permalink / raw)
  To: David Thiel, zsh-users

On Jun 6,  2:03pm, David Thiel wrote:
}
} Also, does anyone know how to get the
} mailchecking functional with Maildir format mailboxes?

    configure --enable-maildir-support ...
    make

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2 newbie ?s
       [not found]           ` <20010607144618.A18221@dman.com>
@ 2001-06-08  5:13             ` Bart Schaefer
  0 siblings, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2001-06-08  5:13 UTC (permalink / raw)
  To: Clint Adams; +Cc: zsh-users

On Jun 7,  2:46pm, Clint Adams wrote:
} 
} > That might actually be a bit *too* thorough ...
} 
} I agree with the sentiment, though you're discarding all the hostname
} information from /etc/hosts.

Ah, true.

    zstyle -e ':completion:*:ssh:*' hosts 'reply=(
	${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \
			 /dev/null)"}%%[# ]*}//,/ }
	${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*}
	)'

I hate having to throw that /dev/null in there to keep `cat' from reading
stdin; one of those cases where I wish there were a glob-flag for turning
on csh_null_glob.  It's also annoying that $(<...) doesn't do filename
expansion or generation, which is why it has to use `cat' to begin with.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-06-08  5:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-06 21:03 2 newbie ?s David Thiel
     [not found] ` <3B1E9F91.5228C985@cohesive.net>
2001-06-06 23:02   ` David Thiel
2001-06-07  0:26     ` Alan Third
2001-06-07  0:34       ` Mads Martin Jørgensen
2001-06-07 16:33         ` Bart Schaefer
     [not found]           ` <20010607144618.A18221@dman.com>
2001-06-08  5:13             ` Bart Schaefer
2001-06-07 17:22 ` Bart Schaefer

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).