zsh-users
 help / color / mirror / code / Atom feed
* searching through "last words"
@ 2020-01-24 18:09 Dominik Vogt
  2020-01-25 18:01 ` Mikael Magnusson
  0 siblings, 1 reply; 3+ messages in thread
From: Dominik Vogt @ 2020-01-24 18:09 UTC (permalink / raw)
  To: Zsh Users

I'd like to enhance Alt-. = insert-last-word a bit:

 - If at the beginning of a word, just work like insert-last-word
   (i.e. if pressed multiple times, replace the word by older last
   words).

 - If there is already something on the command line, work like
   above, but match only words that begin with the present string.

Example history:

 ... bar
 ... foo
 ... baz
 ... foobar

Then type

  $ ... <Alt-.>
  $ ... foobar<Alt-.>
  $ ... baz<Alt-.>
  $ ... bar<Alt-.>
  etc.

But

  $ ... b<Alt-.>
  $ ... baz<Alt-.>
  $ ... bar<Alt-.>

Is there a simple way to do that, short of programming a new widget?

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt

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

* Re: searching through "last words"
  2020-01-24 18:09 searching through "last words" Dominik Vogt
@ 2020-01-25 18:01 ` Mikael Magnusson
  2020-01-25 20:47   ` Dominik Vogt
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Magnusson @ 2020-01-25 18:01 UTC (permalink / raw)
  To: dominik.vogt, Zsh Users

On 1/24/20, Dominik Vogt <dominik.vogt@gmx.de> wrote:
> I'd like to enhance Alt-. = insert-last-word a bit:
>
>  - If at the beginning of a word, just work like insert-last-word
>    (i.e. if pressed multiple times, replace the word by older last
>    words).
>
>  - If there is already something on the command line, work like
>    above, but match only words that begin with the present string.
>
> Example history:
>
>  ... bar
>  ... foo
>  ... baz
>  ... foobar
>
> Then type
>
>   $ ... <Alt-.>
>   $ ... foobar<Alt-.>
>   $ ... baz<Alt-.>
>   $ ... bar<Alt-.>
>   etc.
>
> But
>
>   $ ... b<Alt-.>
>   $ ... baz<Alt-.>
>   $ ... bar<Alt-.>
>
> Is there a simple way to do that, short of programming a new widget?

Sounds a lot like you want _history-complete-older ?

-- 
Mikael Magnusson

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

* Re: searching through "last words"
  2020-01-25 18:01 ` Mikael Magnusson
@ 2020-01-25 20:47   ` Dominik Vogt
  0 siblings, 0 replies; 3+ messages in thread
From: Dominik Vogt @ 2020-01-25 20:47 UTC (permalink / raw)
  To: Zsh Users

On Sat, Jan 25, 2020 at 07:01:27PM +0100, Mikael Magnusson wrote:
> On 1/24/20, Dominik Vogt <dominik.vogt@gmx.de> wrote:
> > I'd like to enhance Alt-. = insert-last-word a bit:
> >
> >  - If at the beginning of a word, just work like insert-last-word
> >    (i.e. if pressed multiple times, replace the word by older last
> >    words).
> >
> >  - If there is already something on the command line, work like
> >    above, but match only words that begin with the present string.
> >
> > Example history:
> >
> >  ... bar
> >  ... foo
> >  ... baz
> >  ... foobar
> >
> > Then type
> >
> >   $ ... <Alt-.>
> >   $ ... foobar<Alt-.>
> >   $ ... baz<Alt-.>
> >   $ ... bar<Alt-.>
> >   etc.
> >
> > But
> >
> >   $ ... b<Alt-.>
> >   $ ... baz<Alt-.>
> >   $ ... bar<Alt-.>
> >
> > Is there a simple way to do that, short of programming a new widget?
>
> Sounds a lot like you want _history-complete-older ?

Hm, ist there any kind of documentation?  It seems to be bound to
"Alt-/", but when pressed it results in an error message:

  _history:58: failed to find end of command substitution

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt

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

end of thread, other threads:[~2020-01-25 20:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-24 18:09 searching through "last words" Dominik Vogt
2020-01-25 18:01 ` Mikael Magnusson
2020-01-25 20:47   ` 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).