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

Re: shared history but recalling history in current terminal



On Nov 26, 10:31pm, Wayne Davison wrote:
>
> bindkey '^p' up-line-or-local-history
> 
> up-line-or-local-history() {
>     zle set-local-history 1
>     zle up-line-or-history
>     zle set-local-history 0
> }
> zle -N up-line-or-local-history

Another possibility is something like:

zle-line-init() { zle set-local-history 1 }
zle -N zle-line-init

zle-keymap-select() {
    [[ $KEYMAP = isearch ]]
    zle set-local-history $?
}
zle -N zle-keymap-select

Then incremental search is non-local history, everything else is local,
and you don't have to re-create individual keybindings.



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