[systemd-devel] [PATCH] systemctl: add edit verb

Mantas Mikulėnas grawity at gmail.com
Fri Oct 17 04:29:49 PDT 2014


On Fri, Oct 17, 2014 at 2:24 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Mon, 13.10.14 13:40, David Herrmann (dh.herrmann at gmail.com) wrote:
>
>> Hi
>>
>> On Sat, Oct 11, 2014 at 8:17 PM, Daniel Buch <boogiewasthere at gmail.com> wrote:
>> > Nice, I was in the process of implementing this. Looks good to me. But I
>> > think it would be better to use "vi" instead of "vim" if no &editor is set.
>> > Vim is not installed on every system as default but vi is most likely.
>>
>> I'd prefer doing nothing. "vi" has quite different behavior than
>> "vim", especially in Ex mode. And for people uncomfortable with 'vi'
>> it's even worth. And everyone should have set EDITOR anyway..
>
> Technically proficient people will set $EDITOR or $VISUAL
> anyway. Non-technical people won't. Non-technical people are likel to
> be totally lost in vi/vim. For those folks probably nano makes a
> better choice, simply because it shows an explanation of they
> supported keys at the bottom of the screen.
>
> Hence, I think doing a logic like this would make sense:
>
> 1) if $EDITOR is set, use it
> 2) otherwise: if $VISUAL is set, use it
> 3) otherwise: if "nano" exists, use it
> 4) otherwise: if "vim" exists, use it
> 5) otherwise: if "vi" exists, use it

The list of editors seems fine.

Normally $VISUAL would be first, followed by $EDITOR...

(But in practice nobody sets them to different values anyway, since no
programs aside from mailx care about the distinction. So it's fine
either way, and just ignoring $VISUAL would be just as good.)

-- 
Mantas Mikulėnas <grawity at gmail.com>


More information about the systemd-devel mailing list