Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Assorted questions
- X-seq: zsh-users 15100
- From: Simon Friedberger <simon+zsh@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Assorted questions
- Date: Tue, 8 Jun 2010 11:12:56 +0200
- In-reply-to: <AANLkTikZUYfGgyW6FlgpkjlPdvYGzHBXdUeD6FEMThip@xxxxxxxxxxxxxx>
- 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
- References: <20100605192316.GB26738@xxxxxxxxxx> <AANLkTikZUYfGgyW6FlgpkjlPdvYGzHBXdUeD6FEMThip@xxxxxxxxxxxxxx>
On 16:23 Mon 07.06.10, Wayne Davison wrote:
> bindkey '^p' up-line-or-local-history
> bindkey '^n' down-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
> down-line-or-local-history() {
> zle set-local-history 1
> zle down-line-or-history
> zle set-local-history 0
> }
> zle -N down-line-or-local-history
Oh this is quite wonderful. Exactly what I've been looking for.
Now, I'm not sure that's the way I want to do it because I'm a little
overwhelmed by the many different options of history search right now
but this is what I tried first:
1 zle set-local-history 1
2 global-history-incremental-pattern-search-backward() {
3 zle set-local-history 0
4 zle history-incremental-pattern-search-backward
5 zle set-local-history 1
6 }
7 zle -N global-history-incremental-pattern-search-backward
8
9 global-history-incremental-pattern-search-forward() {
10 zle set-local-history 0
11 zle history-incremental-pattern-search-forward
12 zle set-local-history 1
13 }
14 zle -N global-history-incremental-pattern-search-forward
This has several problems. For starters the first line fails with:
"widgets can only be called when ZLE is active"
Then there seems to be a problem when repeatedly pressing ^r. While
normally this will search for the next occurrence but in this case it
resets the search.
Does anybody with more zle widget experience know how to fix this?
Best regards
Simon
Messages sorted by:
Reverse Date,
Date,
Thread,
Author