Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] initialization of main keymap



On 2022-09-01 22:06:03 -0700, Bart Schaefer wrote:
> Upon further thought ...
> 1) It's a bit odd that if both VISUAL and EDITOR are set, and VISUAL
> is not set to a variant of vi, but EDITOR is, then zsh prefers to use
> the bindings corresponding to EDITOR.
> 2) As written the patch will always give Vincent the emacs bindings
> because strstr() starts at the beginning and finds "vinc17" before
> ever looking beyond the rindex().
> 
> Perhaps we should prefer VISUAL any time it is set?

Yes, the current behavior (with or without the patch) is definitely
incorrect. For instance, https://unix.stackexchange.com/a/4861/74516
suggests to set VISUAL to the full-screen editor, and either leave
EDITOR unset or set it to "vi -e" (just in case a special line mode
would be needed in some context). So a user who would use VISUAL=emacs
and EDITOR="vi -e" would probably be annoyed by the current behavior.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




Messages sorted by: Reverse Date, Date, Thread, Author