How to change the default shell editor in Ubuntu June 18, 2008
Posted by claudio in Uncategorized.Tags: editor, Shell, Ubuntu, vi, vim
trackback

Using nano as the default shell editor is probably a great choice for a Gnu/Linux distribution (also) aimed for Unix newbies. If you know your way on the command line however, you’ll scream from frustration for every “i”, “:wq!” or “ZZ” you type and you see the characters in the text you are editing. Specially frustrating in cron. If you don’t know what “i”, “:wq!” or “ZZ” do, don’t worry, nano is working fine for you.
Here what to do to change the system wide settings (instead of using the EDITOR variable):
claudio@brisbane:~$ sudo update-alternatives --config editor
[sudo] password for claudio:
There are 4 alternatives which provide `editor'.
Selection Alternative
-----------------------------------------------
1 /usr/bin/vim.tiny
2 /bin/ed
*+ 3 /bin/nano
4 /usr/bin/vim.basic
Press enter to keep the default[*], or type selection number: 4
Using '/usr/bin/vim.basic' to provide 'editor'.
Thanks this was helpful to me.