How to add shortcut keys for java code in eclipse

type "syso" and then press ctrl + space

OR

type "sysout" and then press ctrl + space


Type "Sysout" and then Ctrl+Space. It expands to

System.out.println();

The feature is called "code templates" in Eclipse. You can add templates with:

Window->Preferences->Java->Editor->Templates.

Two good articles:

  • Don't write the code, generate it
  • Custom Templates

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.


Type syso and ctrl + space for System.out.println()