zsh-users
 help / color / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: dominik.vogt@gmx.de, Zsh Users <zsh-users@zsh.org>
Subject: Re: searching through "last words"
Date: Sat, 25 Jan 2020 19:01:27 +0100
Message-ID: <CAHYJk3Q2AxCVYPasPQ=mpkuXVa8GJVmhO3fUYPxcHkYsXYeabw@mail.gmail.com> (raw)
In-Reply-To: <20200124180916.om3fvx6ipypr3kta@gmx.de>

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

  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 18:09 Dominik Vogt
2020-01-25 18:01 ` Mikael Magnusson [this message]
2020-01-25 20:47   ` Dominik Vogt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3Q2AxCVYPasPQ=mpkuXVa8GJVmhO3fUYPxcHkYsXYeabw@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=dominik.vogt@gmx.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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