Many utilities in Ubuntu Linux use a text editor to edit configuration options and files. One example of this is using the crontab command, that allows you to edit your cron jobs using the default editor.
It’s quite easy to set the default editor using the update-alternatives command. Open a terminal and type in the following command:
sudo update-alternatives –config editor
Here is an example of what you’ll see:
$ sudo update-alternatives –config editor
There are 5 alternatives which provide `editor’.
Press enter for keeping the default[*] or type selection number:
You can select the editor you want by just typing in the number. Eg.if you want to change the default editor to vim, you just hit the number 1.
You can test this out by typing in crontab -e to edit your cron file. You will see the editor that you have chosen, instead of the default.