The Incredible Vim 7
Today Bram Moolenaar announced the release of Vim 7, the text editor that I've been "enslaved" to for several years. I've been using Vim to code since 2000 when I got frustrated with the clumisness of the notepad-type text editors while I simply couldn't get used to emacs. I had seen people use Vi/Vim to move around text files at amazing speed and make changes 10 times faster than what I could do. I gave Vim a try on and off before but I found the learning curve to be too steep. I knew in order to learn I'll have to force myself to use it day in and day out. So when I started to write code for a living I decided to bite the bullet and forced myself to learn Vim. Even now I don't consider myself to be a power user. I think of myself as somewhere between a newbie and an intermediate. But after using it for several years, when I have to use notepad or gedit or even Word, I find myself keep making these weird mistakes: pound on the Esc key after finished writing a sentence; use "hjkl" to move the cursor instead of the arrow keys; type "dd" thinking it will delete the whole line, etc etc. Alas, I've become a slave of vim.
Although I'm not a power user, there are a couple of new features in Vim 7 that I found incredibly useful: tabs and intelligent completion.

Vim 7 with tabs and a modern IDE-like auto completion.
I've always liked the split window mode of Vim, I found it very useful to do cut and paste across multiple files. In this new version they come up with a new trick: tabs. It allows you to switch between multiple files quickly by typing 'gt' in command mode. If you use Gvim or your terminal program supports it, you can even switch between tabs with a mouse click. Yes I know you can use :e to open multiple files and switch between them using :buf <buffe_number>, but it's no where as convenient as just typing 'gt'. Also having the tabs at the top of the screen gives you a good idea of which files you've opened. This feature is just incredibly useful and I probably will use it instead of the split window mode or using screen and have multiple instances of Vim running. (Split window mode is still useful when I have to type something while looking at another file.)
Another new feature is the improved auto completion. There was auto completion before v7 but this time it has been improved that it acts almost like a modern IDE (eg Visual Studio, Eclipse, or even Dreamweaver) when activated. I never really used the old auto completion because it was hard to see what choices you have without the little popup menu, but I think it has improved enough that I'll try to use it whenever I can. (Also, if you look at the screenshot above, it even works across multiple files!) One shortcoming that I noticed though, auto completion is only limited to the keywords already appeared in the files currently opened. If a particular keyword isn't already in the current opened file/files, auto complete will not have the keyword you're looking for. Eg. if you have a HTML file where there's no <table> tag yet and you type <ta then ctrl-p, the popup window will not have 'table' that you're looking for. Basically, it won't help you memorize the tags or function names or etc, it will only helps you type less whenever possible.
There are also other new features, but I don't find those to be particularly useful for me. I do like the better support for Unicode but I still could get it to display some of my UTF-8 encoded files correctly. Unicode support really has never been its forte and I'm not sure if v7 is any improvement. In any case, I was pretty satisfied with v6.4 and the tabs feature in v7 only makes it better. People who are using Vim really should give this new version a try.

Leave a Reply