简体   繁体   English

IntelliJ文件模板光标位置

[英]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. 我正在尝试创建一个IntelliJ文件模板,将光标放在文件中的特定点。 The live templates have $END$ to place the cursor in a position after inserting a live template. 实时模板有$ END $,可在插入实时模板后将光标放在某个位置。 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. 首先,选中“启用实时模板”框,然后在希望光标出现的位置插入#[[$END$]]# The HTML4 File template uses this same variable, so you can refer to it also. HTML4文件模板使用相同的变量,因此您也可以参考它。

Additionally if you would like to use selection feature you can do so by defining adding the variable #[[$MyVar$]]# to your template. 此外,如果您想使用选择功能,可以通过定义将变量#[[$MyVar$]]#到模板中来实现。

I don't think it's possible. 我不认为这是可能的。 IntelliJ is only using the standard Velocity template engine. IntelliJ仅使用标准的Velocity模板引擎。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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