There are two ways to change the default editor:
update-alternatives --set editor /bin/nano
export EDITOR='/bin/nano'
added to~/.bashrc
(single user) or/etc/profile.d/
(all users)
Is there any difference / nuance between them? e.g. availability on multiple distros?
UPDATE
There is also select-editor
bash
users on most systems, but not for users of other shells?EDITOR=editor
and configure the alternatives to point to whatever real editor. Covers most bases.editor
? Is that just a symlink to something defined by `update-alternatives" tool?editor
is a symlink.