If you are designing a command line tool and you want to use an interactive text editor as an advanced modal input, please don't use Vim. It's a fine text editor, but its UI is obfuscated to a point I can't stress enough. Throwing your users into Vim is absolutely unfriendly as it doesn't tell them how to use it, it doesn't even tell its name so users can't look up how to use that interactive prompt online. Please instead consider using Nano, it works better as an advanced prompt.

@KekunPlazas What I've found works best is to open whatever $EDITOR is, or let the user type in the editor binary they want to use.

AUR helpers usually do this and it works incredibly well.


@MatejLach @KekunPlazas definitely concur: please respect $EDITOR (as in fact lots of things do).

that said, i was curious how, say, git decides on a default editor when it's not configured. turns out it's just a to "vi" that can be overridden in the Makefile. "use nano by default in places like this" seems like fine advice.

@brennen @MatejLach @KekunPlazas Respecting EDITOR is of course perfect. But vi as default is absolutely OK. It's standard for like 50 years.

@Mac_CZ @MatejLach @KekunPlazas vi wasn't even called "vi" until 40 years ago, but that aside...

look, i live in vim. i'm hacking on an increasingly absurd and elaborate customization to my vim setup in another window as i write this. should people learn a vi at some point? yeah, totally. but we're at a point when we're lucky if we can get people (and in "people" i include like full-time programmers with advanced computer science degrees!) to do or understand _anything_ in a terminal.

@Mac_CZ @MatejLach @KekunPlazas and hell, nano isn't even a bad or especially nonstandard editor. it's built on the idea of pico, which was the first editor i learned on a unix, in like 1994, well before i had the faintest idea that vi(m) or emacs existed. and pico's only 10 or 15 years younger than vi-proper.

@brennen @MatejLach @KekunPlazas I worked on Solaris, Sinix, HP-UX, AIX and vi was everywhere by default. Nobody heard about pico. It was never widespread.

@Mac_CZ i now repent of my impulse to argue with you about text editors.

@brennen I don't want to argue also. Just think, that following standards is always the easiest solutions, because then your workflow works everywhere. And vi is POSIX.

Sign in to participate in the conversation

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!