zsh-users
 help / color / 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, back to index

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

zsh-users

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git