The vi editor is not dead!
September 5, 2007 | 12:05 pmI started my career in the Unix and C world and I soon settled for the vi editor when writing program code. The Emacs editor was also there, but it felt like a dinosaurian, bloated and clumsy. I liked the idea behind editing in vi, being small, quick and fast. Vi is a modal editor and that means (simplified) it either operates in insert/append-mode or in command-mode. What makes it unique is that when in command mode, all keys are used as command keys. For example d$ means delete from cursor to the end of line, M means move cursor to the middle of screen or y3w means copy (yank) the three words following after cursor to buffer. This allows you to perform all editing functions with no use of the mouse or menus and minimal use of CTRL and ALT keys. Keys can be combined and you can do a whole lot with a few keystrokes. When you have the key combinations in your muscle memory you can work real fast. If you have never tested vi, have a look at vim, the de facto vi editor of today. The learning curve is quite steep, but if you stay with it you will be rewarded. Know one editor real well and use it as much as possible. I like to work ergonomic and use the keyboard , relax my arms and avoid the mouse as much as possible, so I still use vi-clones as often as I can. To me the mouse is an evil thing.
Vi was created by Bill Joy back in 1976. Now it is 2007 and we have full featured integrated development environments. But guess what, you can still use the good old vi-paradigm. Almost every day I do work in both Eclipse and Visual Studio 2005. They are highly configurable and since people still like the vi idea there are plug-ins that make the IDE editor work like vi.
For Eclise we have the excellent viPlugin, which I have used for a number of years.
To get the vim control characters to work, do the following in Eclipse; go to menu Window – Preferences and choose General and then Keys. Click on the modify tab and choose ViPlugin in the Scheme drop down box. You will lose some usable functionality, like CTRL-F which is the eclipse find dialogue, so you might want to stay with the default scheme and add those vim-commands you especially like, for ex CTRL-D and CTRL-U.
For Visual Studio 2005 we have viEmu. The company even has a plug-in that gives you vi emulation in MS Word!
In both these cases the vim-functionality is blended into the IDE’s all functionality, like building, refactoring etc in a quite seamless way.
You can find a good quick reference card for vim here.










