16

When you create a new project in WebStorm, you are given the option to create a new directory structure prepopulated with files: libraries, stylesheets, etc. for patterns like HTM5 boilerplate, Twitter boilerplate, etc.

How does one create one's own template for this? Is importing dummy projects the hack for it?

InteXX
  • 6,135
  • 6
  • 43
  • 80
Kenji
  • 379
  • 3
  • 10
  • 3
    AFAIK list of supported project templates is hard-coded as it requires some special support form IDE for each of such template. Currently IDE does not support user's own project templates. – LazyOne Jun 24 '13 at 11:17
  • 1
    Thanks for info - I had the same question. Really would be a nice feature. – Adam Pflantzer Oct 25 '13 at 19:01

2 Answers2

5

I suggest not using templates. I find it far more easy and maintainable to create "empty" projects (from existing projects, of course) in a git repo (bitbucket, github, ...), clone one, and start from there.

The .idea should be in the repo, but .idea/workspace.xml should be ignored, as per the documentation.

This gives you the opportunity to gradually refine your template, and share it easily with a team.

Jan Dockx
  • 111
  • 2
  • 7
2

Use the LivePlugin plugin to create a project template:

<projectTemplate projectType="foo" templatePath="resources/bar.zip" category="true"/>

Use the Velocity Template Language (VTL) to create a file template:

File and code templates are written in the Velocity Template Language (VTL). So they may include:

Fixed text (markup, code, comments, etc.). 

In a file based on a template, the fixed text is used literally, as-is.

File template variables. 

When creating a file, the variables are replaced with their values. #parse directives to include other templates defined in the Includes tab on the File and Code Templates page of the Settings dialog box.

Other VTL constructs.

References

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265