Archive for March 23, 2009

Changing your default editor

Posted: March 23, 2009 in Debian, Slackware

Tired of having ‘vi’ (elvis actually) as the default editor when launching stuff like ‘crontab -e’ and such from the commandline? Would you much rather have emacs, joe, pico or some other editor as the default? It is easy to change, just set the environment variable VISUAL to the full path of your favorite editor, and it will be used instead.

To do it, just execute this command:

$ export VISUAL=/usr/bin/nano

Now ‘nano’ is the default editor. You can make this change permanent for a single user by putting the ‘export VISUAL=’ line into the .bash_profile file in the home dir of the user in question, or you can make it a systemwide default by putting it into the /etc/profile file.