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

Re: Enhanced history-incremental-search



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

The "cycle" part is left as an exercise, because that's not supported
natively by the history-incremental-* widgets.  The user-contributed
history-pattern-search and history-beginning-search-menu widgets may
also be helpful.




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