Sharing IntelliJ IDEA Live Templates

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 JetBrainsDevelop with pleasure!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s