Linux provides a system tool called alternatives, which allows us to have multiple tools installed that each provide the same functionality. Using this tool we can tell the system which one we would like to use as the default, leaving the others available but not primary. To use the alternatives tool to change your default editor, use the command:

sudo update-alternatives –-config editor

You should be presented with a menu similar to this:

There are 4 alternatives which provide `editor'.
Selection    Alternative
1    /usr/bin/vim.tiny
2    /bin/ed
3    /bin/nano
*+        4    /usr/bin/vim.gnome
Press enter to keep the default[*], or type selection number:

Your options may vary depending on which editors you have installed. No matter what your options are, simply select the number you would like to use and your default editor is updated.

Post By Editor (2,827 Posts)

Website: →