From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id FAA22458 for ; Thu, 20 Jun 1996 05:08:41 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id OAA24231; Wed, 19 Jun 1996 14:57:22 -0400 (EDT) Resent-Date: Wed, 19 Jun 1996 14:57:22 -0400 (EDT) From: schaefer@z-code.ncd.com (Barton E. Schaefer) Message-Id: <960619115807.ZM20491@zyrcon.z-code.com> Date: Wed, 19 Jun 1996 11:58:07 -0700 In-Reply-To: Zefram "Re: zsh, vi mode, vihistorysearchbackward" (Jun 19, 6:04pm) References: <27400.199606191704@stone.dcs.warwick.ac.uk> Reply-To: schaefer@z-code.ncd.com X-Face: czU|*h"p8AX?4.I.yU.^s%TIMx|"-s,*'|#H^|e,QjE&!jL%<]:-.U/;khS%3a2BC5_d#)( mz=$$G0u9P&*N8cA~b[URf;lgKRif@#qEf[ltie#Gg0%6$b`e`k.Cgw:\qJx\\a7c(K7^3;gXW:e1@ J, jdl@clinicom.com (J.D. Laub), zsh-workers@math.gatech.edu Subject: Re: zsh, vi mode, vihistorysearchbackward Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"FkYol1.0.Xw5.Is4on"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1366 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jun 19, 6:04pm, Zefram wrote: } Subject: Re: zsh, vi mode, vihistorysearchbackward } } >I can see how "/" should seem to be "search forward" and "?" should be } >"search backward", but this works exactly opposite as it did before. } } We are trying to emulate vi, rather than ksh. As a vi user, I find the } new bindings much more intuitive -- ? is a backward search, so that's } what I use to search backward through the history. In point of fact, I never in memory have *ever* wanted to search forward through the history. (If I had my druthers, *any* search other than an immediate repeat of the previous search would always start at the current command (the end of the history) and go backwards; treating the history as if it were a file being edited makes no sense to me at all.) I think the ksh behavior is more intuitive, because I don't think of history as existing in more than one direction; so having two commands to search it is confusing enough to begin with. Further, it's really confusing to have ESC-/ fail to find something that you know you typed only moments before. If `/' isn't going to search backwards, then it at least ought to wrap around (like "wrapscan" in vi). I don't use vi mode, so I haven't bothered complaining about it before. } If you really want to have the default state match ksh, give everyone a } .zshrc including these bindings. Is there a way to tell from within the shell that it was invoked as ksh? Perhaps an /etc/zshenv like this: if [[ -o interactive && $0 = *ksh ]] then bindkey -a / vi-history-search-backward bindkey -a \? vi-history-search-forward fi -- Bart Schaefer Vice President, Technology, Z-Code Software schaefer@z-code.com Division of NetManage Corporation http://www.well.com/www/barts http://www.ncdsoft.com/ZMail/