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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s