From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8264 invoked by alias); 8 Jun 2010 09:13:08 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15100 Received: (qmail 601 invoked from network); 8 Jun 2010 09:13:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at a-oben.org does not designate permitted sender hosts) Date: Tue, 8 Jun 2010 11:12:56 +0200 From: Simon Friedberger To: zsh-users@zsh.org Subject: Re: Assorted questions Message-ID: <20100608091256.GA21957@a-oben.org> References: <20100605192316.GB26738@a-oben.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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