* replacing completion
@ 2002-05-08 14:00 Andrei Zmievski
2002-05-08 14:39 ` poeml
2002-05-08 15:53 ` Bart Schaefer
0 siblings, 2 replies; 8+ messages in thread
From: Andrei Zmievski @ 2002-05-08 14:00 UTC (permalink / raw)
To: zsh-users
Hi,
I'm trying to write a completion command that accomplishes the
following. When I type 'ssh foo' and hit TAB, I want it to expand to
'user@foo.someplace.net'. I am not very skilled in zsh completion
specifications, so I tried this:
compctl -k hosts -x 's[foo]' -k '(user@foo.someplace.net)' -- ssh
But it actually expands to 'foouser@foo.someplace.net' since the
original 'foo' I typed stays. Is there a way around it?
-Andrei
* The best source is the source code. *
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: replacing completion
2002-05-08 14:00 replacing completion Andrei Zmievski
@ 2002-05-08 14:39 ` poeml
2002-05-08 14:44 ` Andrei Zmievski
2002-05-08 15:53 ` Bart Schaefer
1 sibling, 1 reply; 8+ messages in thread
From: poeml @ 2002-05-08 14:39 UTC (permalink / raw)
To: zsh-users
On Wed, May 08, 2002 at 09:00:45 -0500, Andrei Zmievski wrote:
> Hi,
>
> I'm trying to write a completion command that accomplishes the
> following. When I type 'ssh foo' and hit TAB, I want it to expand to
> 'user@foo.someplace.net'. I am not very skilled in zsh completion
> specifications, so I tried this:
It seems you could also add
Host foo
User user
to .ssh/config, so the ssh client would take care of that itself.
(Not that I want to prevent you from having fun with hacking on
completion :)
Peter
--
Thought is limitation. Free your mind.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: replacing completion
2002-05-08 14:39 ` poeml
@ 2002-05-08 14:44 ` Andrei Zmievski
0 siblings, 0 replies; 8+ messages in thread
From: Andrei Zmievski @ 2002-05-08 14:44 UTC (permalink / raw)
To: zsh-users
On Wed, 08 May 2002, poeml@cmdline.net wrote:
> It seems you could also add
>
> Host foo
> User user
Yes, I could. :)
> to .ssh/config, so the ssh client would take care of that itself.
> (Not that I want to prevent you from having fun with hacking on
> completion :)
But that's where the fun is. :)
-Andrei http://www.gravitonic.com/
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: replacing completion
2002-05-08 14:00 replacing completion Andrei Zmievski
2002-05-08 14:39 ` poeml
@ 2002-05-08 15:53 ` Bart Schaefer
2002-05-08 16:00 ` Andrei Zmievski
1 sibling, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2002-05-08 15:53 UTC (permalink / raw)
To: Andrei Zmievski, zsh-users
On May 8, 9:00am, Andrei Zmievski wrote:
}
} compctl -k hosts -x 's[foo]' -k '(user@foo.someplace.net)' -- ssh
compctl -k hosts -x 's[foo]' -k '(user@foo.someplace.net)' -U -- ssh
However, I'd suggest that you switch from compctl to the newer function-
based completion system, assuming you have zsh 4.0.something.
--
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] 8+ messages in thread
* Re: replacing completion
2002-05-08 15:53 ` Bart Schaefer
@ 2002-05-08 16:00 ` Andrei Zmievski
2002-05-08 16:23 ` Bart Schaefer
0 siblings, 1 reply; 8+ messages in thread
From: Andrei Zmievski @ 2002-05-08 16:00 UTC (permalink / raw)
To: Bart Schaefer; +Cc: zsh-users
On Wed, 08 May 2002, Bart Schaefer wrote:
> compctl -k hosts -x 's[foo]' -k '(user@foo.someplace.net)' -U -- ssh
Didn't work. Here's the result:
10:59 cassandra[309] ssh foo<TAB>
10:59 cassandra[309] ssh foouser@foo.someplace.net
> However, I'd suggest that you switch from compctl to the newer function-
> based completion system, assuming you have zsh 4.0.something.
Yes, I have 4.0.2. I guess I will look at the new style completion.
By the way, did PHPerl come from Doug McEachern's initial effort? I
remember looking at it a few months ago.
-Andrei http://www.gravitonic.com/
"When I get a little money, I buy books;
and if any is left I buy food and clothes." -- Erasmus
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: replacing completion
2002-05-08 16:00 ` Andrei Zmievski
@ 2002-05-08 16:23 ` Bart Schaefer
2002-05-14 7:47 ` Sven Wischnowsky
0 siblings, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2002-05-08 16:23 UTC (permalink / raw)
To: Andrei Zmievski; +Cc: zsh-users
On May 8, 11:00am, Andrei Zmievski wrote:
} Subject: Re: replacing completion
}
} On Wed, 08 May 2002, Bart Schaefer wrote:
} > compctl -k hosts -x 's[foo]' -k '(user@foo.someplace.net)' -U -- ssh
}
} Didn't work.
Hmm, it works in 3.0.x. Looks like a bug has been introduced into
`compctl -U' at some point in the 4.0 series.
Sven?
--
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] 8+ messages in thread
* Re: replacing completion
2002-05-08 16:23 ` Bart Schaefer
@ 2002-05-14 7:47 ` Sven Wischnowsky
2002-05-14 13:23 ` Andrei Zmievski
0 siblings, 1 reply; 8+ messages in thread
From: Sven Wischnowsky @ 2002-05-14 7:47 UTC (permalink / raw)
To: zsh-users
Bart Schaefer wrote:
> On May 8, 11:00am, Andrei Zmievski wrote:
> } Subject: Re: replacing completion
> }
> } On Wed, 08 May 2002, Bart Schaefer wrote:
> } > compctl -k hosts -x 's[foo]' -k '(user@foo.someplace.net)' -U -- ssh
> }
> } Didn't work.
>
> Hmm, it works in 3.0.x. Looks like a bug has been introduced into
> `compctl -U' at some point in the 4.0 series.
Sorry for the delay.
It irritates me that it works in 3.0.x. Because, as the docs say, a
`s[...]' string is meant to be left alone. A `S[...]' string can be
changed by the completion code and with
compctl -k hosts -x 'S[foo]' -k '(user@foo.someplace.net)' -U -- ssh
it works for me.
Bye
Sven
--
Sven Wischnowsky wischnow@berkom.de
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: replacing completion
2002-05-14 7:47 ` Sven Wischnowsky
@ 2002-05-14 13:23 ` Andrei Zmievski
0 siblings, 0 replies; 8+ messages in thread
From: Andrei Zmievski @ 2002-05-14 13:23 UTC (permalink / raw)
To: Sven Wischnowsky; +Cc: zsh-users
On Tue, 14 May 2002, Sven Wischnowsky wrote:
> Sorry for the delay.
>
> It irritates me that it works in 3.0.x. Because, as the docs say, a
> `s[...]' string is meant to be left alone. A `S[...]' string can be
> changed by the completion code and with
>
> compctl -k hosts -x 'S[foo]' -k '(user@foo.someplace.net)' -U -- ssh
>
> it works for me.
Thanks!
-Andrei http://www.gravitonic.com/
We all have photographic memories, it's just
that some of us don't have any film.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2002-05-14 13:24 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-08 14:00 replacing completion Andrei Zmievski
2002-05-08 14:39 ` poeml
2002-05-08 14:44 ` Andrei Zmievski
2002-05-08 15:53 ` Bart Schaefer
2002-05-08 16:00 ` Andrei Zmievski
2002-05-08 16:23 ` Bart Schaefer
2002-05-14 7:47 ` Sven Wischnowsky
2002-05-14 13:23 ` Andrei Zmievski
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).