rlucas.net: The Next Generation Rotating Header Image

June 21st, 2006:

Vim 7.0 Delights and Amazes with Beautified Auto-completion

Randall Lucas 2006-06-21

Vim, the text editor extraordinaire, came out with version 7.0 last month. At some point, unwittingly, I had updated my work computer — Cygwin under Windows XP — using the Cygwin setup.exe file, not expecting any major version number changes. Hence, I didn’t even realize that Vim 7 was now on my machine.

This morning, I was doing as I normally do in writing a document with many recurrences of the same word — “ctrl-N” to cycle through possible completions of the word — when an odd grey-and-purple blob appeared below my cursor, filled with words! Unsettled, I lifted my fingers from the keys — what was this colorized monstrosity?

And then I realized. Vim was giving me “tool tips.” Here, in a console window, using naught but VT100 control codes. Jaded IDE addicts will say: “sure, but my GUI IDE has had those for years.” Perhaps. But I can use my tool tips in a German cybercafe, over an SSH session from a Danger Hiptop, or over a serial line in a generic data center.

For Perl, populating the tool tips with syntactically valid items (method names, operators, etc.) will be hard, at least according to the conventional notion that “only perl can parse Perl.” But, for Ruby, Python, and, should the need arise, C or Java, adding syntax-awareness (see “:help complete-items”) should be just an exercise in glue coding.

If you manipulate text (and if you aren’t already an adept of another cult editor), then by all means get Vim!