tags:

views:

94

answers:

2

Here is the situation. I have the following Java code:

String a;
a.

Right after I press the "." I get the popup menu with the String methods. I choose one, fill in the arguments, but then I have to press the right-arrow key to get past the ) so I can type in the ;

In Emacs I used a macro (meta-Enter I think) which, when pressed, would add a semicolon to the end of the current line and then place me in the next line, at the proper indentation. Is there such a macro in eclipse?

+1  A: 

This solution automatically inserts the semicolon at the end of the line, but you'll still have to type it:

Preferences > Java > Editor > Typing > check "semicolons"

Still, better than nothing.

Samuel_xL
I had not seen that. Thanks. But, after checking that box I repeated the steps in the question and no semicolons are added.
Jose M Vidal
When you type a semicolon, this option puts it at the end of the line, no more no less. I know it doesn't solve the issue you're facing, but it's an improvement (2 keys to press instead of 3), so I mentioned it.
Samuel_xL
ok, it seems that this is the best we can do. thanks!
Jose M Vidal
A: 

I don't know which OS you are using, but don't forget that Eclipse, like the rest of the applications on your system, can be manipulated using external macro programs using simple UI commands.

I use a Mac and I use a program called Keyboard Maestro. What you asked took me about a minute to perform. Simply go to the end of the line, type ";" and press return to go to the next line (Eclipse takes care or indenting). I'm sure you can find similar tools for your OS of choice.

zvikico