Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Enhanced history-incremental-search



I'm a big fan of history-substring-search, which lets you type any portion of a command and just hit ↑ and scroll through the matches.  No need for Ctrl+R keyboard combo, just arrow keys.

https://github.com/zsh-users/zsh-history-substring-search

Zach Riggle



On Wed, Aug 17, 2022 at 2:24 AM Dominik Vogt <dominik.vogt@xxxxxx> wrote:
On Tue, Aug 16, 2022 at 01:27:07PM -0700, Bart Schaefer wrote:
> On Tue, Aug 16, 2022 at 3:41 AM Dominik Vogt <dominik.vogt@xxxxxx> wrote:
> >
> > I'd like to have a context sensitive kind of
> > history-incremental-search-*.
>
> history-beginning-incremental-search-backward () {
>   zle -U "^${LBUFFER}${BUFFER:+*}"
>   zle history-incremental-pattern-search-backward -K ipsearchback
> }
> zle -N history-beginning-incremental-search-backward
> bindkey ^R history-beginning-incremental-search-backward
> bindkey -A isearch ipsearchback
> bindkey -M ipsearchback ^R history-incremental-search-backward

Thanks a lot, that works fine!

> The "cycle" part is left as an exercise, because that's not supported
> natively by the history-incremental-* widgets.

That was only bad choice of words.  In a history with two million
lines it is pointless to search in cycles.

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt



Messages sorted by: Reverse Date, Date, Thread, Author