Am 27. August 2017 23:43:38 MESZ schrieb Jeremie Courreges-Anglas <jca@wxcvbn.org>:
>On Sun, Aug 27 2017, Florian Ermisch <florian.ermisch@mailbox.org>
>wrote:
>> Hi Jeremie,
>>
>> Am 27. August 2017 17:57:57 MESZ schrieb Jeremie Courreges-Anglas
><jca@wxcvbn.org>:
>>>On Sun, Aug 27 2017, Jan Stary <hans@stare.cz> wrote:
>>>> This is current/amd64. I am using ksh(1) as a shell.
>>>> Using ^R opens a search in the command history.
>>>> However, with 'export EDITOR=vi', pressing ^R
>>>> just literarily types '^R' and does not open
>>>> the history search. Is that expected?
>>>
>>>EDITOR=vi puts the shell cli editor in vi mode,
>>> see EDITOR and VISUAL in the manpage.
>>> "Traditional" but quite annoying behavior.
>>
>> Shouldn't setting VISUAL override this
>> function of EDITOR? AFAIK most tools
>> look at EDITOR when choosing which
>> editor ("visual" or not) to spawn for things
>> like commit messages and not VISUAL.
>
>I think most tools do use VISUAL, then EDITOR if VISUAL isn't set, then
>some kind of default. VISUAL being a fullscreen editor like vi(1), and
>EDITOR a line editor like ed(1).
>
>> I'd think setting EDITOR to vi (or vim) and VISUAL to emacs should
>give you the
>> behavior you want.
>
>If the intent is to use vi, this doesn't work with programs that first
>check VISUAL (eg crontab -e).
>
>Rather:
>VISUAL=vi
>maybe EDITOR=vi if some of your tools don't look at VISUAL.
>set -o emacs
You're right, it's a custom one
({SUDO,HG,GIT…}_EDITOR), then VISUAL,
then EDITOR. ksh's manpage got me
confused were it's "EDITOR unless VISUAL
is set" and not "1st VISUAL than EDITOR".
Shouldn't make those claims without
testing this late at night.
Of course `set -o emacs` if you want
to have EDITOR=vi _and_ ^R.
Regards, Florian
No comments:
Post a Comment