Friday, July 28, 2006

Completing the Completer

I've been feeling the pain lately. My wrists are starting to hurt from typing too much. How can I type less while coding?

For the past week I've been considering changing editors. Currently I use nano because the key bindings are similar to the bash shell, it supports Perl syntax highlighting, and it works anywhere. But there is a crucial feature it lacks - the ability to do string completion in a file - I need this to save on keystrokes, short term memory and context switching.

So I've gone on a mission searching for an editor that fits my criteria: Perl syntax highlighting, in-file text completion, cross-platform, ideally works in a terminal, ability to customise key bindings, with a minimal learning curve. Here are just some of the editors I tried: mp, vim, vi, glimmer, gobby, emacs, kate, kwrite, nano, jpico, joe, jed, nedit, jedit, bluefish and others.

The winner is kwrite and an honorable mention goes to mp (minimum profit) for many reasons including this quote from the mp man page, "it helps you abandon vi, emacs and other six-legged freaks definitely."

The downside of kwrite is it won't work on a remote terminal and annoyingly flashes on start up - but apart from that it does the trick: in-file string completion.

Ok. So where does The Goo come in? Well it helps stick Things together by injecting a special comment into the file you're about to edit that is laden with Perl reserved words and context-sensitive method names. The string completion feature in your editor (e.g., vi, emacs, kwrite) sees the comment and picks up an expanded lexicon of keywords to use in string completion.

When you exit the editor the special comment is removed. Great! Less keystrokes, less context switching (no more looking up method names), and it works across different editors. Check it out:

No comments: