开发者

Transferring Intellij Live Templates Between Machines

开发者 https://www.devze.com 2023-04-06 22:25 出处:网络
I\'m trying to figure out how to transfer the templates in the /.IdeaC10/config/templates/user.xml file to my coworker\'s 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 t开发者_开发百科hose 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...!


Use File | Imprort/Export Settings.


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.


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

<your_user_home_directory>\
  .IntelliJIdea<version>\
    config\
      settingsRepository\
        repository\
          templates


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


You need to create the required custom template groups and update the relevant predefined groups as necessary and click OK. Based on these changes, IntelliJ IDEA generates the <group_name>.xml files, see Location of Custom Live Templates Definitions above.

Depending on the operating system you are using, the .xml files are stored at the following locations:

Windows: <your_user_home_directory>.IntelliJ IDEA<version_number>\config\templates
Linux: ~IntelliJ IDEA<version>\config\templates
OS X: ~/Library/Preferences/IntelliJ IDEA<version>/templates

Refer to Intellij Help article.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号