10

I have some live templates in Webstorm that I would like to share with my team mates.

I can see that there is a way to export live templates from WebStorm, however, this just seems to do a blanket export of all live templates to a .jar file.

Is there a way to target specific templates, or a specific group of live templates to export, so I don't end up giving my team mates a whole lot of templates that are irrelevant to them?

If not, it would be acceptable if I could export my live templates to some sort of text file instead so that I could remove any irrelevant templates manually.

Also, I have seen some plugins that add live templates to WebStorm. If it is not too difficult to create such a plugin, it would be fine if someone can point me in the right direction on how to do that.

IngageStroliaC
  • 245
  • 1
  • 3
  • 8
  • 1
    I discovered 2 different ways to handle this (in Windows). 1. %USERPROFILE%\.WebStorm6\config\templates is where the live templates are stored for each user. This can be copied from your directory to another person's directory and it will appear after Webstorm is restarted 2. The exported .jar is apparently just a .zip file with the extension changed to .jar (I'm not a java dev, so I didn't realize this). The contents of the zip file can be modified and rezipped and then imported to another person's webstorm. – IngageStroliaC Aug 12 '13 at 16:39
  • Note: I'd post as an answer to my own question, but apparently I don't have enough cred to do that yet. I'd still be interested in seeing other working answers if there are any. – IngageStroliaC Aug 12 '13 at 16:40

1 Answers1

16

The easiest way to do this is to copy the desired .xml from ~/.WebStorm*/config/templates to the target WebStorm config directory

lena
  • 90,154
  • 11
  • 145
  • 150
  • I don't see this folder on my mac, WebStorm 9 – user2727195 Dec 10 '14 at 00:36
  • 2
    it is ~/Library/Preferences/WebStorm9/templates on Mac. See https://intellij-support.jetbrains.com/entries/23358108 – lena Dec 10 '14 at 12:29
  • Thanks Lena for the info... it works, please also tell me the location on windows – user2727195 Dec 10 '14 at 15:44
  • 2
    On Windows it's usually ~/.WebStorm9/config/templates. Please see https://intellij-support.jetbrains.com/entries/23358108 – lena Dec 10 '14 at 16:01
  • Would be really helpful if these templates including all custom mods to WS settings could be exported in one settings.jar file. Migrating from WS9 to WS10 leaves a lot of stuff behind that I need to transfer manually which leads to less pleasant UX. – demisx Apr 18 '15 at 17:44
  • In PhpStorm 2016 on Windows the path is ~\.PhpStorm2016.1\config\templates\ (you may want create the templates subfolder if it doesn't exist yet). – István Ujj-Mészáros Apr 04 '16 at 23:28