Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transferring Intellij Live Templates Between Machines

I'm trying to figure out how to transfer the templates in the /.IdeaC10/config/templates/user.xml file to my coworker's machines.

If I copy into the user.xml file, then those changes seem to be getting squashed by Intellij, reverting to the old file contents.

Anyone know how to work around this?

EDIT:

Is there any way to do this by copying and pasting the xml? That would be preferrable...!

like image 997
Alex Baranosky Avatar asked Sep 22 '11 14:09

Alex Baranosky


4 Answers

Use File | Imprort/Export Settings.

like image 187
CrazyCoder Avatar answered Oct 13 '22 09:10

CrazyCoder


If you have Settings Repository set you may find your Live Templates stored in

<your_user_home_directory>\
  .IntelliJIdea<version>\
    config\
      settingsRepository\
        repository\
          templates
like image 31
Jaroslav Záruba Avatar answered Oct 13 '22 07:10

Jaroslav Záruba


An improved and easier way

This allows you to share them easily between collegues.

You can select multiple live templates and then copy them (right click and select copy, or ctrl+c). This gives you XML-descriptions in your clipboard you can send to others.

Other can then take that XML, and paste it into a "Template Group". Right click one of the groups and select Paste. If the option is greyed out, you didn't select a group but something else.

like image 26
Matsemann Avatar answered Oct 13 '22 09:10

Matsemann


the technique of copying and pasting the xml file on another computer in the correct directory, function perfectly for me! But the name of my template file is android.xml for my Android developments. Maybe the file name "user" is protected. Try maybe with a different file name

like image 42
letroll Avatar answered Oct 13 '22 09:10

letroll