With one arm out of action for the next few weeks anything I can do to type less is good. A few days ago Zen Coding popped up on my radar and today I finally found a few minutes to tinker and try it out.
This is the holy grail of lazy typing! Basically it’s a plugin available for a host of popular editors. And while they don’t mention Eclipse specifically they do mention Aptana. Digging around on their wiki I found these helpful instructions:
- Install EclipseMonkey using update site: http://download.eclipse.org/technology/dash/update (you can skip this step if you have Aptana installed)
- Create top-level project in your current Eclipse workspace, name it, for example, zencoding
- Create scripts folder inside newly created project
- Extract contents of downloaded zip plugin into this folder. The project structure may look like this:
- Restart Eclipse/Aptana if needed
I did this on my vanilla Eclipse/CFEclipse/Aptana install and after a restart it worked!
I popped open a .cfm file and typed the following and then clicked on the Scripts > Zen-Coding > Expand Abbreviation menu.
td*5
As I had seen that in some of the example and it immediately spit out
<td></td> <td></td> <td></td> <td></td> <td></td>
You can easily add more tags, ids/classes, etc. That is a very simple example. There is a ton more stuff it can do:
Current features of abbreviation engine
- ID and CLASS attributes: div#page.section.main.
- Custom attributes: div[title], a[title="Hello world" rel], td[colspan=2].
- Element multiplication: li*5 will output <li> tag five times.
- Item numbering with $ character: li.item$*3 will output <li> tag three times, replacing $ character with item number.
- Multiple ‘$’ characters in a row are used as zero padding, i.e.: li.item$$$ ? li.item001
- Abbreviation groups with unlimited nesting: div#page>(div#header>ul#nav>li*4>a)+(div#page>(h1>span)+p*2)+div#footer. You can literally write a full document markup with just a single line.
- div tag name can be omitted when writing element starting from ID or CLASS: #content>.section is the same as div#content>div.section.
It’s open source so extending it to support .cfm would be an interesting possibility!
The only drawback so far is some of the keyboard shortcuts don’t work in Eclipse but they are easily changed (see wiki).
With a ton of syntax shortcuts luckily there are several cheat-sheets available as well. But I can see this being a huge timesaver. While I can mimic some of this with snippets and AutoHotKey – the dynamic nature of this plugin makes those pale in comparison.
Learn more: http://code.google.com/p/zen-coding/

Great find, I could see this being pretty useful in certain situations :)
That does look like a neat tool, Jim! In regards to the one-handed typing, it’s not worth buying just for temporary use, but have you seen a FrogPad? It’s specifically designed for one-handed use, mainly as a portable keyboard device, but some people learn to use it to type with one hand and mouse with the other (less switching back and forth).
I did look at the FrogPad and if they actually had them for sale I probably would have bought one!