intellij-ideajetbrains-idelive-templates

Choose position of cursor after a live template


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?


Solution

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

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