Choose position of cursor after a live template

Arnaud Denoyelle picture Arnaud Denoyelle · Jun 17, 2014 · Viewed 8.4k times · Source

In IntelliJ IDEA, I have defined a live template like this:

@Inject
private void postInject() {
  //I want the cursor to be placed here after the execution of the live template.
}

Is there a way to tell IntelliJ to place the cursor inside of the method body after expanding the live template?

Answer

Peter Gromov picture Peter Gromov · Jun 17, 2014

Sure. Just put the special $END$ variable to that position.

Help documentation: https://www.jetbrains.com/help/idea/template-variables.html#pdtv