views:

7405

answers:

11

Anybody know of a good eclipse plugin for recording and playing back macros? I've tried this one, but it didn't do me any good- seemed like it wasn't ready for primetime.

I know about editor templates, but I'm looking for something that I can use to record my keystrokes and then apply multiple times against a wad of text.

This seems like a strange hole in an IDE, am I missing some builtin facility for this?

+3  A: 

This seems like a strange hole in an IDE, am I missing some builtin facility for this?

This is a common problem, there are around 4 bugs opened in Eclipse tracker for this. Unfortunately you would probably see macros in Eclipse in v4.0 or later.

Ilya Kochetov
+4  A: 

There was a plug-in called Eclipse Monkey which allows writing Scripts that execute inside the IDE. It was terminated about a month ago due to lack of interest. It is based on an older plug-in called Groovy Monkey. If you google it, you can still get it. The Aptana team has some more information on using it.

Note that this allows writing scripts, but not recording actions.

zvikico
+3  A: 

Just for the record, there is another project called MacroSchmacro that does eclipse macros, but it doesn't record many important things (like searching to navigate). It is also extremely slow.

rcreswick
+11  A: 

I put something together over the last month or so that you may find useful. It has limitations since the Eclipse editor/commands weren't designed with macro support in mind, but I think it works reasonably well. I just posted it out at SourceForge a couple of days ago. It requires Eclipse 3.4. https://sourceforge.net/project/showfiles.php?group_id=242831&package_id=296347&release_id=635310

Awesome! Thanks for the pointer.
Tim Howland
Link appears to be broken. Correct link is: http://sourceforge.net/projects/practicalmacro/
Templar
+4  A: 

Practical Macro plugin seems to do a pretty good job.

splintor
+2  A: 

For simple text expansion on a Windows computer, you could use AutoHotkey. It's not as powerful as most macro tools, but since it's not tied to any one program, it can be used in other editors, emails, etc.

For example, if I type ";;ln" AutoHotkey instantly sends the keystrokes to delete this and replace it with "System.out.println();" with the cursor in between the perentheses.

Matt Boehm
I'm on linux, but I've found some use from AutoKey, which is pretty similar.
Tim Howland
+1  A: 

Ernest, thanks for the tip.

Still, there is a problem installing the Practically Macro v0.3.3 in Eclipse 3.5 (Galileo) and cannot be installed normally by Help->Install New Software But can be successfully installed by copying the .jar package file directly in eclipse\plugin\ directory, and restarting eclipse.

slava
+3  A: 

Emacs+ Version 3.x adds keyboard macros (http://www.mulgasoft.com/emacsplus) to its feature set.

mfeber
Nifty! I'll have to give it a shot.
Tim Howland
A: 

@Matt Boehm: Thanks for the idea to use AutoHotKey! My programming life just got a little better!

Trickoder
A: 

I've had success using AutoHotKey.

KevinO
A: 

Talking about emacs, Jedit has a very strong macro facility. There are a lot of high quality macros and plug-ins, and several macros are already built it in. You can even add some logic using bean scripting, which is analogous to VBA. So, you can write very powerful stuff (any many people have done so).

Jedit is obviously a separate editor, but I think it's worth a shot. See http://www.jedit.org/

luiscolorado