Live Templates

Use Live Templates to auto-complete common code structures for you.

Live Templates reduce the amount of code you need to type for the more common code constructs. You can use psvm or main to create the main Java method, for example. There are lots of live templates including fori for a for loop and nn for not null, plus many more.

Other options include:

  • iter
  • sout
  • souv

It's also possible to create a custom live template. We walked through how to create this live template in the JUnit 5 Tutorial.

You can see a list of all available live templates in Preferences/Settings | Editor | Live Templates.


Related Resources

New live templates for main methods
New live templates for main methods
Create an instance main method using a live template.
Live templates for simple IO
Live templates for simple IO
Add simple IO methods using live templates.
Inlay Hints
Inlay Hints
Inlay hints provide additional information about your code.