22

When programming Java in Eclipse, I can type syso and press control+space to auto-complete this and get System.out.println();. I was wondering if there are settings somewhere in Eclipse to allow me to set other shortcuts of this form. (For instance, I'd like to type syscur and have this auto-complete to System.currentTimeMillis();.)

Sal
  • 3,179
  • 7
  • 31
  • 41

2 Answers2

35

You can do this here: Window -> Preferences -> Java -> Editor -> Templates. You can also add a Template View, which you find at Window -> Show View -> Other -> Search for Templates.

Micha Wiedenmann
  • 19,979
  • 21
  • 92
  • 137
Kai
  • 38,985
  • 14
  • 88
  • 103
3

This feature is called Code Templates

Christophe Roussy
  • 16,299
  • 4
  • 85
  • 85