Is there a keyboard shortcut to automatically add the semicolon at the end
of a line?
I know that CTRL+ENTER (I think) moves the cursor to the next line, but it
would be very helpful for me if there was a shortcut to add the semicolon
before going to the next line...
Eugen wrote:
> Is there a keyboard shortcut to automatically add the semicolon at the
> end of a line?
>
> I know that CTRL+ENTER (I think) moves the cursor to the next line, but
> it would be very helpful for me if there was a shortcut to add the
> semicolon before going to the next line...
>
But there is! Put your cursor end of line and press SHIFT + ,
Jasmo is messing with you. (SHIFT + ,) on some keyboard layouts is the
semicolon. Inserting a semicolon at the end of the line is as simple as
pressing end semicolon. It's no harder than any other key-press
combinations. But I guess the point is that you don't want the cursor to
move... In that case, I think you're out of luck. Looks like the Java and
Javascript editors might have though. I think you can set it so that when
you press semicolon, it inserts it at the end of the line. Never tried
though so I can't say for sure.
David
Eugen wrote:
> hmmm... I tried (SHIFT + ,), but it doesn't work... it just adds the "<"
> character...
It is a useful feature and saves time indeed if you are a serious developer
1) install Practically Macro for eclipse http://sourceforge.net/projects/practicalmacro/ by copying the .jar file into eclipse/plugins directory and restarting eclipse
2) record a macro - macro buttons (record, play etc.) will show up, press record and enter your key combination (for me on mac it is: Opt-Left, ';', Enter to get to the end of the line add a semicolon and a newline). Press record again to stop a macro and give a name to it
3) Go to preferences (Opt-, on mac) General -> Keys, and type the name of the macro and give it a shortcut (I have Opt-Enter)
Now each time you've finished typing a statement in php or c++ you just enter Opt-Enter (for example) - that saves you three shortcuts.