Change Default Editor in Ubuntu
In Ubuntu, many of the utilities use the editor to edit the configuration files.
Some of the command like visudo , crontab -e, etc uses the editor to edit there corresponding files. By default, nano is the editor.
In case if you wanted to update or change the default editor you can do it very easily using update-alternatives command.
Lets see how can we do it.
Run Command:
sudo update-alternatives — config editor
Now you can select any editor by entering the sequence number.
For Example, I have selected vim which is option 4
You can validate that editor has changed or not using a command like visudo etc. You should see the editor that you chose, instead of the default.
That’s it.
Happy Learning