zsh-users
 help / color / mirror / code / Atom feed
* insert-last-word/copy-prev-word/... question
@ 2002-03-01 14:33 Dominik Vogt
  2002-03-06 10:22 ` poeml
  0 siblings, 1 reply; 3+ messages in thread
From: Dominik Vogt @ 2002-03-01 14:33 UTC (permalink / raw)
  To: zsh-users

Let's assume I have this in the history

  ls xxx xxx foo
  ls xxx xxx bar
  ls yyy zzz baz

And I'm typing a new command line:

  $ ls first second next 
                         ^
                         cursor

with insert-last word, I can copy "baz", "bar", "foo" to the
cursor position.  With copy-prev-word I can copy "next".  But I'd
like to

 - Call some function multiple times.  With the first call I get
   "next".  WIth the second call I get "second" and with the
   third call I get "first".
 - The same should work on previous lines in the history:  First I
   call insert-last and get "baz", then I call said function and
   get "zzz", then I call it again and get "yyy".

Is that possible?

Bye

Dominik ^_^  ^_^

-- 
Dominik Vogt, email: d.vogt@lifebits.de
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20


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

* Re: insert-last-word/copy-prev-word/... question
  2002-03-01 14:33 insert-last-word/copy-prev-word/... question Dominik Vogt
@ 2002-03-06 10:22 ` poeml
  2002-03-06 10:57   ` Dominik Vogt
  0 siblings, 1 reply; 3+ messages in thread
From: poeml @ 2002-03-06 10:22 UTC (permalink / raw)
  To: zsh-users

On Fri, Mar 01, 2002 at 03:33:13 +0100, Dominik Vogt wrote:
> Let's assume I have this in the history
> 
>   ls xxx xxx foo
>   ls xxx xxx bar
>   ls yyy zzz baz
> 
> And I'm typing a new command line:
> 
>   $ ls first second next 
>                          ^
>                          cursor
> 
> with insert-last word, I can copy "baz", "bar", "foo" to the
> cursor position.  With copy-prev-word I can copy "next".  But I'd
> like to
> 
>  - Call some function multiple times.  With the first call I get
>    "next".  WIth the second call I get "second" and with the
>    third call I get "first".
>  - The same should work on previous lines in the history:  First I
>    call insert-last and get "baz", then I call said function and
>    get "zzz", then I call it again and get "yyy".
> 
> Is that possible?

How about simply prefixing insert-last with a multiplier, is that what
you want (not sure if I understand correctly)? 

Like "meta-2 meta-." which would give you "zzz" in you example. 

Peter
-- 
Thought is limitation. Free your mind.


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

* Re: insert-last-word/copy-prev-word/... question
  2002-03-06 10:22 ` poeml
@ 2002-03-06 10:57   ` Dominik Vogt
  0 siblings, 0 replies; 3+ messages in thread
From: Dominik Vogt @ 2002-03-06 10:57 UTC (permalink / raw)
  To: zsh-users

On Wed, Mar 06, 2002 at 11:22:57AM +0100, poeml@cmdline.net wrote:
> On Fri, Mar 01, 2002 at 03:33:13 +0100, Dominik Vogt wrote:
> > Let's assume I have this in the history
> > 
> >   ls xxx xxx foo
> >   ls xxx xxx bar
> >   ls yyy zzz baz
> > 
> > And I'm typing a new command line:
> > 
> >   $ ls first second next 
> >                          ^
> >                          cursor
> > 
> > with insert-last word, I can copy "baz", "bar", "foo" to the
> > cursor position.  With copy-prev-word I can copy "next".  But I'd
> > like to
> > 
> >  - Call some function multiple times.  With the first call I get
> >    "next".  WIth the second call I get "second" and with the
> >    third call I get "first".
> >  - The same should work on previous lines in the history:  First I
> >    call insert-last and get "baz", then I call said function and
> >    get "zzz", then I call it again and get "yyy".
> > 
> > Is that possible?
> 
> How about simply prefixing insert-last with a multiplier, is that what
> you want (not sure if I understand correctly)? 
> 
> Like "meta-2 meta-." which would give you "zzz" in you example. 

Ah, yes.  I guess you have to already know what the argument to
insert-last-word does to understand the man page :-)  Now, is
there a way to call that with increasing argument values, i.e.

  first call  = Meta-1 insert-last-word
  second call = Meta-2 insert-last-word
  third call  = Meta-3 insert-last-word

...

Bye

Dominik ^_^  ^_^

-- 
Dominik Vogt, email: d.vogt@lifebits.de
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20


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

end of thread, other threads:[~2002-03-06 10:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-01 14:33 insert-last-word/copy-prev-word/... question Dominik Vogt
2002-03-06 10:22 ` poeml
2002-03-06 10:57   ` Dominik Vogt

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