Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"syso" shortcut in Eclipse- changing a bit behaviour

I look for some trick which gives me possibility to change the syso behaviour in Eclipse (please assume that below there is Eclipse´s editor), now it works in this way:

syso%someVariable

% - means the plase when i typed ctrl + space, and result is:

System.out.println();someVariable

but I want to have of course without copying text..:

System.out.println(someVariable);

Any hints ? :-) Thanks in advance !

like image 911
Tomasz Waszczyk Avatar asked Jan 13 '23 00:01

Tomasz Waszczyk


1 Answers

Reference

The feature is called "code templates" in Eclipse. You can add templates with Preferences->Java->Editor->Templates. Two good articles:

  • http://eclipse.dzone.com/news/effective-eclipse-dont-write-c
  • http://eclipse.dzone.com/news/effective-eclipse-custom-templ

Also, this SO question:

  • Useful Eclipse Java Code Templates

System.out.println() is already mapped to sysout, so you may save time by learning a few of the existing templates first.

like image 81
Naveen Kumar Alone Avatar answered Jan 23 '23 23:01

Naveen Kumar Alone