I have two computers where I use IntelliJ IDEA. And I like the live templates feature for inserting code templates I need again and again. But of course I do not want to define them twice, i.e. on each computer, and keep them in sync if I make improvements.
The trick is to symlink the templates folder:
- Create a templates folder in your SCM of choice
- Create a symbolic link from the templates folder inside the IntelliJ IDEA config folder to working copy of the SCM
On Mac OS X with IntelliJ IDEA 11 you can execute following commands on the shell:
cd ~/Library/Preferences/IntelliJIdea11/ ln -s ~/scmWorkingCopy/IntelliJIdea11/templates templates
IntelliJ IDEA Web Help shows you where live templates are stored on other operating systems.
To end this post I want to cite the slogan of JetBrains: Develop with pleasure!