Add variables to file template geneator


As in my school, we have a specific header for C files (.c/.h), generally generated with Emacs, I would like to add the necessarily template file in CLion to avoid using external tools.

However, the actual file template system miss from some variables (SECOND, DAY_NAME_SHORT and FILE_PATH), so posted an issue ( some month ago.

As it doesn't look to be a JetBrains priority, I would like to implement them by myself in the community edition. I tried to find where velocity template' variables are defined, but I didn't found them.

So, could someone tell me where they are defined so I'll try to add this 3 new variables ? (Or maybe they are already defined, but with a different name ?).

Thank you for your help.


See com.intellij.ide.fileTemplates.impl.FileTemplateManagerImpl#getDefaultProperties



Thank you. I added the necessarily variables for the date and time, but how are managed variables specifics to a file, like the file name or (what I'm looking for), the file path ?


See com.intellij.ide.fileTemplates.FileTemplateUtil#createFromTemplate()


Please sign in to leave a comment.