Sunday, 30 March 2008

An easy introduction to Vim

If you're only looking to use Ubuntu as an alternative to Windows (which many people are, and that's fine), then the text editors we've already mentioned (gEdit, Kate, nano) are more than sufficient for your needs. They're more than adequate for things like editing configuration files and creating web pages using HTML.

However, if you're really into Linux and would like to learn more, it's a very good idea to take the time to learn at least one of the two most powerful editors available: Vim or Emacs. However, Vim comes installed on Ubuntu by default whereas Emacs doesn't, so it's a more logical choice to start with (but if you're interested, by all means try Emacs as well).

The version of Vim that comes preinstalled with Ubuntu isn't the full version, but a cut-down version called vim-tiny. To get the full version, you need to enter the following:
sudo apt-get install vim-full
The full version of Vim will be downloaded and installed for you.

Now, Vim may seem rather idiosyncratic at first, but once you begin to get used to it you'll start to see why it's so highly regarded. Unlike something like Notepad, Vim has several modes you have to switch between to carry out different tasks. However, you also don't need to lift your hands from the keyboard very often, making it faster to use.

Now, here's where you'd expect to see a Vim tutorial from me, right? Well, I'm not going to do that because there's a great tutorial already included with it! Just open the terminal and enter the following:
You'll have the opportunity to learn about Vim at your own pace. Now, it is quite a lot to take in (I haven't managed to complete it yet, and I've made several attempts!), but it's worthwhile. At first, it might seem like an uphill struggle, but persist with it and you'll soon get used to Vim's way of doing things. Once you've completed a few of the exercises, you'll never want to go back to nano again!

No comments: