简体   繁体   中英

IntelliJ File Template cursor position

I'm trying to create an IntelliJ file template that will place the cursor at a specific point in the file. The live templates have $END$ to place the cursor in a position after inserting a live template. I'm after the same functionality for a file template. Is this possible?

It's possible. First, check the "Enable Live Templates" box, then insert #[[$END$]]# at the point where you want the cursor to appear. The HTML4 File template uses this same variable, so you can refer to it also.

Additionally if you would like to use selection feature you can do so by defining adding the variable #[[$MyVar$]]# to your template.

I don't think it's possible. IntelliJ is only using the standard Velocity template engine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM