I learned to code ColdFusion with Macromedia Homesite.  While it does its job very well, there came a point where I needed an IDE with more functionality and I made the leap to CFEclipse.  The one growing pain I experienced, though, was losing my keyboard shortcuts.  While in Homesite you can map any combination of keystrokes to any code snippet through the Options->Customize menu, the Eclipse framework limited me to snippets and keyboard shortcuts for built-in functions.  The story I heard was that it was the Eclipse framework that prevented full keyboard shortcut functionality, so using a combination of Trigger Text and AutoHotkey I fixed the problem.

Trigger text: Eclipse allows you to assign text to a snippet and then launch the snippet by typing the trigger text and pressing Ctrl+J to insert it.

AutoHotkey (Windows only) is a small utility that runs in your system tray and lets you use any combination of keystrokes and mouse actions to script virtually any activity on your system.  You use a config file to set up your shortcuts, and each key has a corresponding AHK code (a on the keyboard=”a”, b=”b”,^=Ctrl, +=Shift, !=Alt, etc.)

AutoHotkey has gobs of features which I won’t get into, but the key here (no pun intended) is the “Send” command, which sends keystrokes to the active window.  By sending the trigger text, followed by Ctrl+J to Eclipse, AHK completely opens up your shortcut options.  This is what my config looks like:


^!o::Send object{CTRLDOWN}j{CTRLUP}
^+a::Send cfargument{CTRLDOWN}j{CTRLUP}
^q::Send qp{CTRLDOWN}j{CTRLUP}
^!g::Send getset{CTRLDOWN}j{CTRLUP}
^+g::Send getarg{CTRLDOWN}j{CTRLUP}
^m::Send mailtome{CTRLDOWN}j{CTRLUP}
^+q::Send query{CTRLDOWN}j{CTRLUP}
^+v::Send var{CTRLDOWN}j{CTRLUP}
^+r::Send reqarg{CTRLDOWN}j{CTRLUP}
^!e::Send cfargevent{CTRLDOWN}j{CTRLUP}
^!q::Send fq{CTRLDOWN}j{CTRLUP}
^!s::Send ske{CTRLDOWN}j{CTRLUP}

Each line represents a keyboard shortcut and the corresponding keystrokes it sends to Eclipse.  The first line sends “object”Ctrl+J (without quotes) to Eclipse.  Then in Eclipse I have the following snippet

Object Snippet

Theoretically, you could use AutoHotkey for the entire snippet, but Eclipse’s snippets do add the value of the {squiggly brackets} which allow you to set up arguments for your snippet.  When I launch the snippet above, for example, Eclipse will ask me the path in a popup.  There’s much more complexity to this, which I won’t get into here.

I’ve barely scratched the surface of what AutoHotkey can do.  For more you can look at Lifehacker’s extensive posts about it.