From: Jan Larres <jan@majutsushi.net>
To: zsh-users@zsh.org
Subject: Local/global history with pattern isearch
Date: Mon, 03 Mar 2014 17:19:53 +1300 [thread overview]
Message-ID: <lf0vss$4ri$1@ger.gmane.org> (raw)
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
next reply other threads:[~2014-03-03 4:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-03 4:19 Jan Larres [this message]
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
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='lf0vss$4ri$1@ger.gmane.org' \
--to=jan@majutsushi.net \
--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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).