Learn to Use A Real Editor, or: Vim Tips and Tricks

For years I have been recommending that users diving into the Linux world, or who otherwise expect to get into contact with something unix-like, learn to master vi. The simple reason is that this editor, though feeling a little arcane at times, is very powerful, and almost ubiquitious. It works almost the same across all systems that you might encounter, from the now 30 years old workstation that you find in the dumpster, to the most recent netbook or mainframe computer. So you learn the program once, and use it a lifetime - how's that for a cost/benefit ratio? And contrary to popular belief, you can learn the basics of this program in about an hour.

Plus, this editor lets you work on your text in much more efficient manners than you used to, if all you have seen so far are the typical end-user type of editors (like Notebook under Windows, Joe, Jove, or likely even CodeWright and friends). The catch is that you need to make some effort to actually learn how to use it. But here is where the differences start: While other editors may have a man page or help file that allows you to master the program, vi has had a learning program since ages.

If you are on a halfway modern Linux system, I highly recommend using vim, which also exists for other platforms (example shown assumes Debian):

$ apt-get install vim

Then invoke

$ vimtutor

and plough through the lessons to master this program. There are also numerous tips and tricks on the web, but today, this very nice blog post caught my eye:

Vim anti-patterns

The web page contains a very nice overview over the basic functions of the program. Kudos to the author of the page, and enjoy!

Of course, feel free to ask questions if you are running into trouble.

Comments