Is There a MACro Recorder for Eclipse

Is there a macro recorder for Eclipse?

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 Practical Macro at SourceForge a couple of days ago. It requires Eclipse 3.4.

Stop recording a macro in Eclipse

You start recording a macro using CtrlAltR and stop in the same way.

You can also use the buttons on the toolbar:

PracticallyMacro toolbar buttons

Macro functionality with keyboard shortcuts in Eclipse?

There doesn't seem to be anything else than Practically Macro for Eclipse. Once you use a Macro, you can press Ctrl-Alt-P to replay that. This helps a bit, but when you want to switch between a couple of macros back and forth doesn't help much.

Can I set up a keybind/hot key/macro to paste a line into Eclipse?

In Eclipse Preferences, go to Java->Editor->Templates

Click on "new" to create a new template.

In your template, write in the "pattern" textarea the command you want to be pasted.
For example :

throw new IllegalArgumentException("");

And in the "name" textbox, write the word that matches to that command.

Then, in Eclipse, in your Java Editor, write that word + auto-completion.
Eclipse will propose you,among others may be, your template.

The sysout command name is that template :

System.out.println(${word_selection}${});${cursor} 

Workspace Editor Macros in Eclipse

See my answer at How can I launch more than one debug session in Eclipse from a single click? . The same plugin can work for you as well.

Is there a standard action that inserts text, that can be used in a key binding?

You can try the Eclipse plugin Practically Macro. It allows you to record macros but also to define it by hand.

To create a short key that inserts "§" in your editor you must do the following steps:

  1. Go into "Preferences/Practically Macro Options/Editor Macro Definitions" and create a new macro. Add the command "Insert String" and type § in the text field. Then give the macro a name and an id, e.g., "testmacro".

  2. Go to "Preferences/General/Keys" and search for your newly created "testmacro". You can now bind an arbitrary key combination to it.



Related Topics



Leave a reply



Submit