Categories
General

Another eclipse extension

Like this person, I often want to surround the eclipse selection with parens. For example, “42” becomes “(42)” with the cursor before the first paren, ready to turn into “foo(42)”. Combined with eclipse’s structured selection, this is pretty handy. For the last while, I’ve used a template for this. It requires a few keystrokes though, so was a prime target for optimization.

So tonight I threw together an extension called Parens which does it in a single keypress. The surprising thing was that it worked perfectly first time I ran it. This never happens!

I’m starting to like customizing eclipse. it’s not quite as ‘discoverable’ as emacs is .. largely due to it’s modular nature and careful dependency tracking. However, given that emacs’s lack of modularity and dependency tracking drive me mad, I can’t complain too much.