I am fairly new to eclipse as far as it regards programming. After reading docs and faqs the whole day, I learned that key sequences can be bound to commands, which in turn can invoke actions (or was it the other way around?). Anyway, I miss a list of “standard actions”, surely, inserting a character in response to a key stroke must be standard? But I din’t find it.
In an editor I want to bind key sequences to actions like “insert character x”, where x is one of a set of characters not on every keyboard (like §°€µöß´, greek letters, etc.).
How do I do this in eclipse?
Do I really have to write a separate command (and or action?) for every character I need? Moreover, if possible I want it to have configurable, of course. But, first things first.
In conventional editors like UltraEdit or jEdit, I would record a macro and bind a key sequence that invokes that. It’s done in 1 minute. In jEdit, such a macro results in one line of bsh code that looks like:
insertText("§");
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:
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”.
Go to “Preferences/General/Keys” and search for your newly created “testmacro”. You can now bind an arbitrary key combination to it.