zsh-users
 help / color / mirror / code / Atom feed
* Local/global history with pattern isearch
@ 2014-03-03  4:19 Jan Larres
  2014-03-03  5:44 ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Larres @ 2014-03-03  4:19 UTC (permalink / raw)
  To: zsh-users

Hi,

a few months ago there was a discussion about how to use the shared
history only for isearch, but not for example for the <Up> arrow search.
Since I use the history-incremental-pattern-search-backward widget
instead of the normal isearch widget the solution didn't work for me,
but Bart suggested this instead:

zle-line-init()  { NUMERIC=1 zle set-local-history }
zle -N zle-line-init
zle-isearch-update() { NUMERIC=0 zle set-local-history }
zle -N zle-isearch-update
zle-isearch-exit()  { NUMERIC=1 zle set-local-history }
zle -N zle-isearch-exit

history-incremental-pattern-search-backward() {
    if [[ $LASTWIDGET != history-incremental-pattern-search-backward ]]; then
        NUMERIC=0 zle set-local-history
    fi
    zle .history-incremental-pattern-search-backward "$@"
}
zle -N history-incremental-pattern-search-backward
bindkey '^r' history-incremental-pattern-search-backward

Unfortunately this still isn't quite working for me. It does use the
shared history when starting the search, but when pressing ^r again it
fails to find any other results, neither in the shared nor in the local
history. The custom function also doesn't get called again in that case,
I don't know if that's normal behaviour or not. I would be grateful if
anyone know how to fix this.

Cheers,
Jan


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-03-11  4:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-03  4:19 Local/global history with pattern isearch Jan Larres
2014-03-03  5:44 ` Bart Schaefer
2014-03-03 23:44   ` Jan Larres
2014-03-06  4:53     ` Bart Schaefer
2014-03-07  6:49       ` Jan Larres
2014-03-07  7:51         ` Bart Schaefer
2014-03-11  4:54           ` Jan Larres

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).