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 i loop and nn for not null, plus many more.

In Depth

Live templates are a really convenient way to get IntelliJ IDEA to fill out standard-shaped code, so we don't have to type it all.

In the video, we saw:

  • iter
  • sout
  • souv

We also saw 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.

Full Video