Changing the default Ubuntu editor

I’ve gotten tired of being presented with the default nano text editor every time I go to write a subversion commit comment or when I run visudo. So I finally figured out how to change the default text editor from nano.

% sudo update-alternatives –config editor

I personally prefer good old vim!