Search code examples
templatesintellij-ideapluginsintellij-plugin

How to add file templates to intellij plugin?


How can i add (already created) file templates to a custom plugin for intellij idea?

The official docs are empty for file templates, only live templates are described.

https://www.jetbrains.org/intellij/sdk/docs/tutorials/live_templates.html


Solution

  • Maybe someone needs the solution too...

    1. Move your file templates to the resources subfolder, e.g. resources/fileTemplates
    2. Add a .ft extension to your template files, e.g. TestTemplate.py.ft

    A good example can be found here: File templates of the Julia plugin for the IntelliJ Platform

    See also: File Template extension with IntelliJ plugin