Another way to change the default text editor in Ubuntu and Debian

In these articles I have showed you how to change the default text editor in Linux and Unix in all the important shells: bash, zsh, ksh, csh and tcsh.

Having your favourite editor as the default one is usefull when you use crontab or visudo, commands which useĀ  the default editor.

Now I will show you how to change the default text editor in Ubuntu, with the update-alternatives –config editor tool, used as root:

$ sudo update-alternatives --config editor

There are 5 choices for the alternative editor (providing /usr/bin/editor).
Selection Path Priority Status
------------------------------------------------------------
* 0 /bin/nano 40 auto mode
1 /bin/ed -100 manual mode
2 /bin/nano 40 manual mode
3 /usr/bin/emacs23 0 manual mode
4 /usr/bin/vim.basic 30 manual mode
5 /usr/bin/vim.tiny 10 manual mode
Press enter to keep the current choice[*], or type selection number: 4

Hit the number representating the editor you want as default and press Enter, to apply the changes.

Tagged with: , , , , ,
Posted in The Linux and Unix Articles!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!