From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19790 invoked from network); 8 Sep 1999 15:56:04 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Sep 1999 15:56:04 -0000 Received: (qmail 5137 invoked by alias); 8 Sep 1999 15:55:46 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2584 Received: (qmail 5128 invoked from network); 8 Sep 1999 15:55:42 -0000 From: "Bart Schaefer" Message-Id: <990908155537.ZM13525@candle.brasslantern.com> Date: Wed, 8 Sep 1999 15:55:37 +0000 In-Reply-To: <19990908150213.D4878@br-online.de> Comments: In reply to Andy Spiegl "Re: is there a mix of history-search-backward and history-beginning-search-backward" (Sep 8, 3:02pm) References: <19990903130450.A28691@br-online.de> <19990908150213.D4878@br-online.de> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-users@sunsite.auc.dk Subject: Re: is there a mix of history-search-backward and history-beginning-search-backward MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 8, 3:02pm, Andy Spiegl wrote: } Subject: Re: is there a mix of history-search-backward and history-beginni } } Hi again! Hello ... } A while ago I asked: } > } > I want to bind to ^P a widget that acts like } > history-beginning-search-backward, but always moves the cursor to the end } > of the line, like history-search-backward does. Or said the other way: } > I want history-search-backward to look at more than the first word. } > } > Do you know a way to get this behavior? } } Does noone have any idea about this? Everyone is probably waiting for everyone else to answer. Now you'll probably get this answer several times. In 3.0.6, there really is no satisfactory way to get this behavior. The closest you can come is to use this kind of binding: bindkey '^Xp' history-beginning-search-backward bindkey -s '^P' '^X^X^Xp^E' The first binding is just something to hang the real thing you want to execute on, so that you can refer to it in the second binding. The second binding maps ctrl-P to the sequence exchange-point-and-mark (^X^X) followed by history-beginning-search-backward (^Xp) followed by end-of-line (^E). The problem is that you have to remember to set the mark with ctrl-space (or whatever you have bound to set-mark-command) before you begin to press ctrl-P repeatedly, or exchange-point-and-mark will jump to the wrong place: zsh resets the mark each time a new prompt is displayed. In 3.1.6, you can create a custom widget as I just saw that PWS has already explained, so I won't repeat him. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com