When using many utilities in Ubuntu Linux, a default text editor is used to allow you to edit configuration options and files. An example of this is using the crontab command. When you run the command to edit cron jobs, the default editor is opened.
It’s easy to change the default text editor using the update-alternatives command. Select Accessories | Terminal from the Applications menu to open a terminal window.
Enter the following command at the command line:
$ sudo update-alternatives –config editor
NOTE: There are two regular dashes before config in the above command.
A list displays the editors available to be the default editor. The list you see may be different depending on which editors are installed on your system. We decided to select vim as our default editor, so we typed 0 at the prompt and pressed Enter.
Test our your selection by typing crontab –e at the command line to edit your cron file.
The crontab file is opened in vim. To exit vim without saving your changes, type :q! and press Enter.
We have previously written about both crontab and vim. See the following posts for more information:
- Automating Tasks in Linux Using Crontab
- Two More User-Friendly Versions of the Vim Text Editor in Ubuntu
by Lori Kaufman




[...] text editor. For more information about changing the default text editor, see our previous post, Change the Default Text Editor in Ubuntu. If you want to install different versions of the vim editor, see our previous post, Two More [...]
[...] NOTE: For information about changing the default text editor in Ubuntu, see our post, Change the Default Text Editor in Ubuntu. [...]