zsh-users
 help / color / mirror / code / Atom feed
* Default setting of ZLE keymap
@ 2023-10-07 21:13 Bart Schaefer
  2023-10-08  2:46 ` Ray Andrews
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Bart Schaefer @ 2023-10-07 21:13 UTC (permalink / raw)
  To: Zsh Users

For just about as long as zsh has existed, interactive shells at
startup have examined the environment variables $VISUAL and $EDITOR
for clues as to whether the default key bindings should be emacs-like
or vi-like.

Recently it was noticed that when one of these variables uses a full
path to name the editor program, the substring "vi" appearing anywhere
in that path (such as, in the name of the user's home directory) would
cause the vi-mode keymaps to be incorrectly enabled.

Two possible approaches have been suggested to address this:
(1) The whole scheme of using VISUAL / EDITOR to select zsh bindings
should be abandoned.  It's obsolete and no one uses those variables
for that purpose any longer.  Zsh should default to emacs behavior
unless an rc-file explicitly performs "bindkey -v".
(2) Continue to look at the two variables, but assure that "vi" has to
appear in the command name, that is, after the rightmost slash in any
path, or in the first word if there are no slashes.

Throwing the question out to a wider audience: If the zsh-users list
expresses no particular preference, or no need for #2, zsh-workers
will proceed with #1.

Discuss.  Thanks.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Default setting of ZLE keymap
  2023-10-07 21:13 Default setting of ZLE keymap Bart Schaefer
@ 2023-10-08  2:46 ` Ray Andrews
  2023-10-10 10:59 ` Eric Cook
  2023-10-10 11:27 ` Peter Stephenson
  2 siblings, 0 replies; 7+ messages in thread
From: Ray Andrews @ 2023-10-08  2:46 UTC (permalink / raw)
  To: zsh-users


On 2023-10-07 14:13, Bart Schaefer wrote:
> Discuss.  Thanks.
>
Good example of software  being too helpful by trying to guess what the 
user intends when everyone would be better off if users were simply left 
to  indicate their preference directly and explicitly -- perhaps even 
being prompted to do so by some friendly setup program.  I'm very happy 
to see zsh purged of something obsolescent.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Default setting of ZLE keymap
  2023-10-07 21:13 Default setting of ZLE keymap Bart Schaefer
  2023-10-08  2:46 ` Ray Andrews
@ 2023-10-10 10:59 ` Eric Cook
  2023-10-10 11:27 ` Peter Stephenson
  2 siblings, 0 replies; 7+ messages in thread
From: Eric Cook @ 2023-10-10 10:59 UTC (permalink / raw)
  To: zsh-users

On 10/7/23 17:13, Bart Schaefer wrote:
> For just about as long as zsh has existed, interactive shells at
> startup have examined the environment variables $VISUAL and $EDITOR
> for clues as to whether the default key bindings should be emacs-like
> or vi-like.
>
> Recently it was noticed that when one of these variables uses a full
> path to name the editor program, the substring "vi" appearing anywhere
> in that path (such as, in the name of the user's home directory) would
> cause the vi-mode keymaps to be incorrectly enabled.

>
> Discuss.  Thanks.
>

It has long been a source of confusion in the irc channel and would be
a welcomed changed in my opinion.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Default setting of ZLE keymap
  2023-10-07 21:13 Default setting of ZLE keymap Bart Schaefer
  2023-10-08  2:46 ` Ray Andrews
  2023-10-10 10:59 ` Eric Cook
@ 2023-10-10 11:27 ` Peter Stephenson
  2023-10-10 13:40   ` Re[2]: " Vadim Zeitlin
  2023-10-11  0:34   ` Aaron Schrab
  2 siblings, 2 replies; 7+ messages in thread
From: Peter Stephenson @ 2023-10-10 11:27 UTC (permalink / raw)
  To: Zsh Users

> On 07/10/2023 22:13 Bart Schaefer <schaefer@brasslantern.com> wrote:
> (1) The whole scheme of using VISUAL / EDITOR to select zsh bindings
> should be abandoned.  It's obsolete and no one uses those variables
> for that purpose any longer.  Zsh should default to emacs behavior
> unless an rc-file explicitly performs "bindkey -v".
>
> Throwing the question out to a wider audience: If the zsh-users list
> expresses no particular preference, or no need for #2, zsh-workers
> will proceed with #1.

Seems like a definite green light for this, as far as I can see.

It's certainly something I've only ever fallen foul of, but I
speak as an emacs user so am not really in the target user group.

pws


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re[2]: Default setting of ZLE keymap
  2023-10-10 11:27 ` Peter Stephenson
@ 2023-10-10 13:40   ` Vadim Zeitlin
  2023-10-10 19:53     ` Lawrence Velázquez
  2023-10-11  0:34   ` Aaron Schrab
  1 sibling, 1 reply; 7+ messages in thread
From: Vadim Zeitlin @ 2023-10-10 13:40 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1490 bytes --]

On Tue, 10 Oct 2023 12:27:26 +0100 (BST) Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:

PS> > On 07/10/2023 22:13 Bart Schaefer <schaefer@brasslantern.com> wrote:
PS> > (1) The whole scheme of using VISUAL / EDITOR to select zsh bindings
PS> > should be abandoned.  It's obsolete and no one uses those variables
PS> > for that purpose any longer.  Zsh should default to emacs behavior
PS> > unless an rc-file explicitly performs "bindkey -v".
PS> >
PS> > Throwing the question out to a wider audience: If the zsh-users list
PS> > expresses no particular preference, or no need for #2, zsh-workers
PS> > will proceed with #1.
PS> 
PS> Seems like a definite green light for this, as far as I can see.
PS> 
PS> It's certainly something I've only ever fallen foul of, but I
PS> speak as an emacs user so am not really in the target user group.

 Just to give a point of view of someone who probably is, I do have a habit
of doing "export EDITOR=vim" when working on somebody else's machine to let
me edit the command line (I'm totally lost with the default key bindings
after so many years of using Vi ones) and also use my preferred editor with
the other programs (notably Git), but I guess this is not a very common use
case.

 Still, I'm not sure how does "nobody uses EDITOR any longer" imply that
zsh shouldn't select the default bindings if it is set: if it's really
never set, there is no harm in continuing to do it and if it is set, it
would help people like me.

 Regards,
VZ

[-- Attachment #2: Type: APPLICATION/PGP-SIGNATURE, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Default setting of ZLE keymap
  2023-10-10 13:40   ` Re[2]: " Vadim Zeitlin
@ 2023-10-10 19:53     ` Lawrence Velázquez
  0 siblings, 0 replies; 7+ messages in thread
From: Lawrence Velázquez @ 2023-10-10 19:53 UTC (permalink / raw)
  To: zsh-users

On Tue, Oct 10, 2023, at 9:40 AM, Vadim Zeitlin wrote:
> On Tue, 10 Oct 2023 12:27:26 +0100 (BST) Peter Stephenson 
> <p.w.stephenson@ntlworld.com> wrote:
>
> PS> > On 07/10/2023 22:13 Bart Schaefer <schaefer@brasslantern.com> wrote:
> PS> > (1) The whole scheme of using VISUAL / EDITOR to select zsh bindings
> PS> > should be abandoned.  It's obsolete and no one uses those variables
> PS> > for that purpose any longer.  Zsh should default to emacs behavior
> PS> > unless an rc-file explicitly performs "bindkey -v".
> PS> >
> PS> > Throwing the question out to a wider audience: If the zsh-users list
> PS> > expresses no particular preference, or no need for #2, zsh-workers
> PS> > will proceed with #1.

I make use of the current behavior but am not attached to it and
don't have a preference between options #1 and #2.

> Still, I'm not sure how does "nobody uses EDITOR any longer" imply that
> zsh shouldn't select the default bindings if it is set

I read "no one uses [VISUAL/EDITOR] for that purpose any longer"
as meaning "no one uses them to select zsh bindings", not "no one
uses them at all".  As Eric and Peter noted, the current behavior
can be confusing.  (It's certainly tripped me up before.)

-- 
vq


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Default setting of ZLE keymap
  2023-10-10 11:27 ` Peter Stephenson
  2023-10-10 13:40   ` Re[2]: " Vadim Zeitlin
@ 2023-10-11  0:34   ` Aaron Schrab
  1 sibling, 0 replies; 7+ messages in thread
From: Aaron Schrab @ 2023-10-11  0:34 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh Users

At 12:27 +0100 10 Oct 2023, Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
>It's certainly something I've only ever fallen foul of, but I
>speak as an emacs user so am not really in the target user group.

I've definitely run into a bit of confusion with this as well in the 
distant past. I'm a vim user, but used to prefer emacs bindings in the 
shell, so that autodetection definitely bit me briefly before I made my 
choice of bindings explicit.

Since then, I *have* switched to using the vi bindings. But, I certainly 
don't rely on the autoselection.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-10-11 20:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-07 21:13 Default setting of ZLE keymap Bart Schaefer
2023-10-08  2:46 ` Ray Andrews
2023-10-10 10:59 ` Eric Cook
2023-10-10 11:27 ` Peter Stephenson
2023-10-10 13:40   ` Re[2]: " Vadim Zeitlin
2023-10-10 19:53     ` Lawrence Velázquez
2023-10-11  0:34   ` Aaron Schrab

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).