Expand live template inside file template
Hello,
Is there an easy way to include a live template and make it expand on new file creation?
I created a live template named "copyright" which contains a year variable and I want to include it in my "file template"
I wish there is a feature for this
Cheers
Please sign in to leave a comment.
You can't use Live templates (snippets/functions) in File Templates. Only Live Templates variables are available (see https://www.jetbrains.com/help/phpstorm/2016.3/file-and-code-templates-2.html#live_template).
Related feature request: https://youtrack.jetbrains.com/issue/IDEA-161937
See https://intellij-support.jetbrains.com/hc/en-us/community/posts/206816669 for more info
Thank you for your reply,
I will try replicating the same effect using the live template variables
Cheers
Note that you can use
${YEAR}file template variable to get a current year in file templateYes that worked very well for me,
Thanks a lot