zsh-users
 help / color / mirror / code / Atom feed
From: Simon Friedberger <simon+zsh@a-oben.org>
To: zsh-users@zsh.org
Subject: Re: Assorted questions
Date: Tue, 8 Jun 2010 11:12:56 +0200	[thread overview]
Message-ID: <20100608091256.GA21957@a-oben.org> (raw)
In-Reply-To: <AANLkTikZUYfGgyW6FlgpkjlPdvYGzHBXdUeD6FEMThip@mail.gmail.com>

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


  reply	other threads:[~2010-06-08  9:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-05 19:23 Simon Friedberger
2010-06-07 16:44 ` Richard Hartmann
2010-06-07 16:50   ` Simon Friedberger
2010-06-07 17:11 ` Mikael Magnusson
2010-06-07 23:23 ` Wayne Davison
2010-06-08  9:12   ` Simon Friedberger [this message]
2010-06-09 19:50     ` Wayne Davison
     [not found]       ` <AANLkTimeIv_xV6qHnFUpHqjD3LmVJqY_r5IQJQGtaKjo@mail.gmail.com>
2010-06-10  6:41         ` Bart Schaefer
2010-06-09 11:40   ` zle set-local-history binding Was: " Simon Friedberger

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=20100608091256.GA21957@a-oben.org \
    --to=simon+zsh@a-oben.org \
    --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).