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

Re: Assorted questions



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