In the intellij products I'm very fond of the live-templates. I wonder if it is possible to use the same syntax for file templates, e.g. formatting a variable to snake- or camel-camese, defining a starting cursor position and so on.
相关问题
- Configure gradle plugin based on future tasks
- How to make available “open this project in Intell
- IntelliJ 2017.1.2 GOLANG debug does not work on br
- JavaFX sample issue
- Could not import the newly generated play framewor
相关文章
- pycharm上传代码到github,为什么不能指定某一个项目,而是默认上传第一个项目
- In IntelliJ IDEA, how can I create a key binding t
- Profiling Django with PyCharm
- IntelliJ IDEA can't open projects or add SDK o
- PHPStorm Code Hinting for array of object arrays
- How to fix this strange error: “RuntimeError: CUDA
- IntelliJ Subversion Authentication Required Dialog
- Pycharm Edu 无法运行代码
Unfortunately you cannot use the same functions/macros available in Live Templates in File Templates.File Templates use Apache Velocity template language. It allows some Java(?) simple methods to be run on variables (e.g.
#set($class_start = $class.substring(0,1).toUpperCase())
). Quite possible that more complex methods will work as well.UPDATE (2017/01/13):
As of 2016.1 (or perhaps 2016.2) version it's now possible to use some Live Templates in File Templates as well (by checking
Enable Live Templates
checkbox for that File template). I'm not 100% sure if it will do the requested here thing (not tested myself).Syntax example:
#[[ $MY_VARIABLE$ $END$ ]]#
https://www.jetbrains.com/help/phpstorm/2016.3/file-and-code-templates-2.html