Last Updated: February 25, 2016
·
195
· orangetux

Change default editor for globally on a Debian based system.

When I install a new Debian based system Nano is always set as the default editor. I want Vim. To change the default editor for all users:

$ sudo update-alternatives --config editor
There are 3 choices for the alternative editor (providing /usr/bin/editor).

Selection    Path                    Priority   Status
------------------------------------------------------------
   0            /usr/bin/vim.nox     40        auto mode
   1            /bin/nano            40        manual mode
 * 2            /usr/bin/vim.nox     40        manual mode
   3            /usr/bin/vim.tiny    10        manual mode

 Press enter to keep the current choice[*], or type selection number: