Zsh Mailing List Archive
Messages sorted by:
Re: vi-history-search(forward|backward) vicmd mappings
- X-seq: zsh-workers 37753
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: vi-history-search(forward|backward) vicmd mappings
- Date: Sat, 23 Jan 2016 16:00:02 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=bP/892xWIvL/i8ZxvVyN1N/aLrKhmNryCDAUcAIid0k=; b=0wq+I9cjr/cmOYRi/amS4St6LETvJYH9Lqk0zOBajdlWqLcMlU5ipBd88ISC2oYJJn I2+ju6OOIR4ftR3wJT1tPpbzRpD6F/Ef3nM2xJzCCLcUaNCDpfUc85ZO9Tns/RhBezNG pUyknY73VXzHShMZy8ewzmFQ/EUL9uvy0OtCwzNvCDCly6+mnBdP9jeS+ZxtP82q3UiL O73P0sSsT9mP3VtI2fZp7ToUvR516RhjYC9dqb9z65YL8z8KzOIilJCjsdk6uFK9Uao6 wj2/1FmAqDEciPDKelTf3tesUKou3KK8VNv3HyGpGOk9/H/vKHAPrlClp6IIxm7P56MS ez/w==
- In-reply-to: <email@example.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <firstname.lastname@example.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
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.
Messages sorted by: