101

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?

Pang
  • 9,564
  • 146
  • 81
  • 122
Arnaud Denoyelle
  • 29,980
  • 16
  • 92
  • 148

1 Answers1

200

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

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

Pang
  • 9,564
  • 146
  • 81
  • 122
Peter Gromov
  • 17,615
  • 7
  • 49
  • 35
  • 4
    Where can I find the documentation for this? – Swanand Feb 26 '16 at 06:40
  • 8
    Note that if there are variables that are not flagged as "Skip if defined", then the cursor will tab through them first before arriving at $END$. – Nathan Williams Feb 07 '19 at 14:10
  • 3
    https://www.jetbrains.com/help/idea/template-variables.html Here is documentation about this feature. – tanaydin Dec 24 '19 at 10:02
  • 2
    Is it possible to add multiple stops and jump to next by TAB button? – Matiss Jan 08 '21 at 10:09
  • Just wanted to say how much better you have made my life just now. Thank you sir. @Matiss as Nathan said, you can put $var$ or whatever you wanna call your variables before $END$ and it will tab through each of them. – Artur Müller Romanov Aug 08 '21 at 19:08