From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3060 invoked from network); 29 Sep 2001 17:18:31 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 Sep 2001 17:18:31 -0000 Received: (qmail 5330 invoked by alias); 29 Sep 2001 17:18:08 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4292 Received: (qmail 5318 invoked from network); 29 Sep 2001 17:18:06 -0000 From: Bart Schaefer Message-Id: <1010929171753.ZM19899@candle.brasslantern.com> Date: Sat, 29 Sep 2001 17:17:53 +0000 In-Reply-To: <87g0963vaf.fsf@lynx.ionific.com> Comments: In reply to Hannu Koivisto "Re: history-incremental-search-backward with a twist" (Sep 29, 5:51pm) References: <87pu8b3tjx.fsf@lynx.ionific.com> <1010929014105.ZM18918@candle.brasslantern.com> <1010929024149.ZM19026@candle.brasslantern.com> <87g0963vaf.fsf@lynx.ionific.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Hannu Koivisto , zsh-users@sunsite.dk Subject: Re: history-incremental-search-backward with a twist MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 29, 5:51pm, Hannu Koivisto wrote: } Subject: Re: history-incremental-search-backward with a twist } } | function beginning-incremental-search { } | if [[ $LASTWIDGET == $WIDGET ]] } | then zle .$WIDGET } | else zle .$WIDGET $LBUFFER } | fi } | } } | } | zle -N history-incremental-search-backward beginning-incremental-search } | zle -N history-incremental-search-forward beginning-incremental-search } } This doesn't seem to do what I want. [...] That } is, your change seems to insert to the bck-i-search: -prompt, as if } I had written it, what I have on the command line at the moment I } invoke the search. Everything to the left of the cursor at the moment you invoke the search, but otherwise yes. } In order to do what I want, such insertion } would work only if a) the search would be regexp search and b) it } inserted "^.*" instead of just } "". Ah. Well, zsh doesn't have re-search, though it does recognize "^" as anchoring to beginning of line. So you could change one line of the above to else zle .$WIDGET "^$LBUFFER" Beyond that, try looking at Functions/Zle/incremental-complete-word in the distribution for ideas of how to implement something more like you want. Or Functions/Zle/predict-on might be easier to modify -- you'd have to replace `zle .history-beginning-search-backward' with your own search. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net