How to change the default editor in Debian and Ubuntu

Posted by mike on August 10, 2008

I’ve been a fan of Ubuntu Linux since I first started using it a few years ago.  One of the first things I do when building a new Ubuntu machine is set the default editor to Vim.  I have been using Vi for a long time and the keyboard shortcuts are very natural for me, so the first time I typed a command like visudo or crontab -e and got the Nano editor, I was shocked.  With Ubuntu 8.04 it’s really very easy:

Open a terminal window (Applications/Accessories/Terminal)
Type: sudo apt-get install vim-full

That should do it.  By default only the vim.tiny package is installed and installing the vim package (apt-get install vim) only gets you vim.basic.  Both of those will leave the default editor as Nano.  Installing the vim-full package will take care of modifying the default editor for you to be vim.gnome.  If you would like to change the setting to something else, or that didn’t work with the version of Debian or Ubuntu that you have, try:

sudo /usr/sbin/update-alternatives --config editor

Then pick the number that corresponds with your choice.

Visual Studio with Vim

Posted by mike on March 05, 2008

I learned about a product today that has completely made my day.

ViEmu It’s a Vi emulation add-in for Visual Studio. Having come to Windows programming from Unix and Linux, I’ve been a long time user of Vi and Vim. One of the difficult things about Visual Studio for me is having to take my hands off of the keyboard to do certain things. In the little bit of time that I’ve been using ViEmu, I feel so much more comfortable. It’s amazing to me how something as simple as this gives such an increased feeling of power and speed in Visual Studio. Ah, what a beautiful day.