Change the default editor in Debian Linux

You can change default editor in Debian Linux with the following command:

 update-alternatives –config editor

This will bring up the following screen asking you to select the editor (number on the Selection field):

There are 9 choices for the alternative editor (providing /usr/bin/editor).

Selection    Path                Priority   Status
————————————————————
* 0            /usr/bin/joe         70        auto mode
  1            /bin/nano            40        manual mode
  2            /usr/bin/jmacs       50        manual mode
  3            /usr/bin/joe         70        manual mode
  4            /usr/bin/jpico       50        manual mode
  5            /usr/bin/jstar       50        manual mode
  6            /usr/bin/mcedit      25        manual mode
  7            /usr/bin/rjoe        25        manual mode
  8            /usr/bin/vim.basic   30        manual mode
  9            /usr/bin/vim.tiny    10        manual mode

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

Press the number 1 if you prefer nano, for example. Enjoy!

Selection    Path                Priority   Status
————————————————————
* 0            /usr/bin/joe         70        auto mode
1            /bin/nano            40        manual mode
2            /usr/bin/jmacs       50        manual mode
3            /usr/bin/joe         70        manual mode
4            /usr/bin/jpico       50        manual mode
5            /usr/bin/jstar       50        manual mode
6            /usr/bin/mcedit      25        manual mode
7            /usr/bin/rjoe        25        manual mode
8            /usr/bin/vim.basic   30        manual mode
9            /usr/bin/vim.tiny    10        manual mode


Leave a Reply