Exporting live templates

In the actionscript/flex world there are lots of third party libraries. It is nice to create live templates for bits of those libraries, however it then seems impossible to export those third party library specific live templates and share them (i.e. import them as well).  In Flashbuilder 4 with sourcemate you can export all sorts of templates and configurations for third party libraries, but I can't see how to do this with IntelliJ - is it possible?

6 comments
Comment actions Permalink

Try File | Export settings / Import Settings, select ''Code style schemes, Code templates, File templates'.
Or just manually copy files located in <IDEA config dir>/templates

0
Comment actions Permalink

But I would like to be able to export just those live templates for a particular library and distribute them.

Then when somebody wants those live templates they simply 'merge' them in with their current settings.

You solution would end up with my entire set of live templates replacing somebody else's which is not ideal :-)

0
Comment actions Permalink

So I suggest to create a bunch of live templates in a new custom groups like 'SomeFlexLibrary1', 'SomeFlexLibrary2' and distribute respective SomeFlexLibrary1.xml and SomeFlexLibrary2.xml files which are stored in <IDEA config dir>/templates. One who wants to use these live templates needs to place these xml files under his/her <IDEA config dir>/templates folder and restart IDEA.

0
Comment actions Permalink

Thanks - will try this later

0
Comment actions Permalink

Sorry for being dumb, but where is the templates directory in OS X? Can't seem to find it anywhere.

0
Comment actions Permalink

Templates folder is <idea.config.path>/templates/,
<idea.config.path> is set in idea.properties file inside IDEA installation, by default it ois
idea.config.path=${user.home}/.IntelliJIdeaXX/config

0

Please sign in to leave a comment.