From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2889 invoked from network); 28 May 2006 06:47:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.2 (2006-05-25) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.2 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 28 May 2006 06:47:56 -0000 Received: (qmail 92167 invoked from network); 28 May 2006 06:47:50 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 28 May 2006 06:47:50 -0000 Received: (qmail 27122 invoked by alias); 28 May 2006 06:47:40 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10323 Received: (qmail 27112 invoked from network); 28 May 2006 06:47:39 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 28 May 2006 06:47:39 -0000 Received: (qmail 90472 invoked from network); 28 May 2006 06:47:39 -0000 Received: from vanunu.ucsc.edu (128.114.150.22) by a.mx.sunsite.dk with SMTP; 28 May 2006 06:47:38 -0000 Received: from localhost (localhost [127.0.0.1]) by vanunu.ucsc.edu (Postfix) with ESMTP id 318382084A56; Sat, 27 May 2006 23:47:35 -0700 (PDT) Date: Sat, 27 May 2006 23:47:35 -0700 (PDT) From: William Scott X-X-Sender: wgscott@vanunu.ucsc.edu To: Bart Schaefer Cc: zsh-users@sunsite.dk Subject: Re: vi mode and history-search key binding In-Reply-To: <060527221713.ZM25658@torch.brasslantern.com> Message-ID: References: <0CDE54A6-04FA-4821-A51D-26552316040A@chemistry.ucsc.edu> <060527221713.ZM25658@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed B On Sat, 27 May 2006, Bart Schaefer wrote: > On May 27, 8:39pm, William Scott wrote: > } > } bindkey '\e[A' vi-history-search-backward > } bindkey '\e[B' vi-history-search-forward > > This binds those keys in the main keymap, which by default is the emacs > keymap. Have you somewhere earlier in your startup files executed a > "bindkey -v" command? If you did, then those bind keys in the viins > keymap (insert mode), not the vicmd keymap (command mode). In which > mode are you attempting to invoke the search? > > } It appears to have no effect. Is this intended? > > The effect you should see is that a quetion-mark (for backward) or slash > (for forward) prompt appears below the PS1 prompt; you then enter the > string to search for. If that doesn't happen, you've probably bound > the keys in the wrong keymap. > Sorry, I misunderstood what vi-history-search-forward, etc, does. bindkey -v bindkey '\e[A' history-search-backward bindkey '\e[B' history-search-forward gives me the desired behavior. Thanks for pointing out what should have been obvious. (I just issued bindkey -v on the command line to experiment. I'm not sure what it says about the ossified state of my brain, but even as a vi(m) user, I can't seem to break the emacs keybinding habbits in the shell. It was far easier to switch from tcsh to zsh. I'll give it the weekend.)