zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: vi-history-search(forward|backward) vicmd mappings
Date: Sat, 23 Jan 2016 16:00:02 -0800	[thread overview]
Message-ID: <160123160002.ZM15365@torch.brasslantern.com> (raw)
In-Reply-To: <n812dv$ka2$1@ger.gmane.org>

On Jan 23, 11:30pm, Larry Hynes wrote:
}
} In fact, if one enters '<ESC>?' on a zsh command line with
} 'bindkey -e' in effect the mini-buffer prompt becomes '/' to
} signify a forward search, and '<ESC>/' produces a '?' to signify
} a backward search, so I propose that the default mappings are,
} perhaps, backwards?

This is intentional.  I've always thought it was a bit weird, but
the reasoning (from 20+ years ago) goes like this:

The vi-*search-* widgets don't include the current buffer, and even
if they did the most common place to invoke a search is at the end
of the command line, and the history only extends backwards in time;
so for all those reasons it almost never makes sense to search in
the "forward" direction.

But the "muscle memory" of most vi users is accustomed to invoking
search by whacking the slash key, not the question mark.  One way
to address this would be for the search to wrap around, but it is
far more common to want to find the most recent command than the
oldest one.

Therefore slash is bound to the most useful search direction, not
to the widget that corresponds by name to the meaning in vi(m).

But sometimes you really do need to search forward, so the "opposite"
keystroke from vi(m) is bound to the opposite search direction, to
avoid having no default foward search binding at all.


  reply	other threads:[~2016-01-23 23:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-23 23:30 Larry Hynes
2016-01-24  0:00 ` Bart Schaefer [this message]
2016-01-24 11:30   ` Larry Hynes
2016-01-24 18:41     ` Bart Schaefer
2016-01-29  3:30       ` Larry Hynes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=160123160002.ZM15365@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).