How can I change the default text editor for console programs in Ubuntu. When I run mutt and send a message, it currently loads up Joe and I would prefet to load Vim. I know I can change $EDITOR for me only, but would prefe to do it system wide.
You can change $EDITOR systemwide. Just drop a short script into
There are two ways (at least :-/) in which a program can find an editor to launch. The traditional Unix/Linux mechanism is to use $EDITOR. In addition to that, Debian (and therefore Ubuntu) has special aliases for various kinds of programs. These are provided by the "alternatives" system (a system of configurable symlinks). For editors this provides the aliases
(same for sensible-editor). This will prompt you for the editor to use.
However, in Debian programs are suppposed to read $EDITOR first:
(Debian Policy Manual, http://www.debian.org/doc/debian-policy/ch-customized-programs.html#s11.4 )
In one sentence: Setting $EDITOR globally should be enough.
the mechanism in ubuntu (debian) used to solve this problem is described in
to change the current "default". with
you can see the currently available alternatives.