Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Local/global history with pattern isearch
- X-seq: zsh-users 18547
- From: Jan Larres <jan@xxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Local/global history with pattern isearch
- Date: Mon, 03 Mar 2014 17:19:53 +1300
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author