Share live templates
Last modified: 20 July 2022PyCharm stores definitions of custom live template groups and templates added to predefined template groups in automatically generated XML configuration files.
For a custom group, the file contains definitions of all the templates the group includes.
For a modified predefined group, the file contains definitions of the added (or modified) live templates only.
Live template group configuration files are stored in the templates directory of the IDE configuration directory. By copying the relevant files in the templates directory, you can share live templates among team members and multiple PyCharm installations. Moreover, you can share live templates across all IDEs based on the IntelliJ platform.
note
If your settings are synchronized through the IDE Settings Sync plugin, templates are stored under jba_config/templates in the IDE configuration directory.
Do not copy the live template configuration files into the project directory.
PyCharm provides the export and import functionality for sharing live templates, which may be more convenient than copying configuration files manually.
Export live template configuration
Choose File | Manage IDE Settings | Export Settings from the menu.
In the Export Settings dialog, make sure that the Live templates checkbox is selected and specify the path and name of the archive, where the exported settings will be saved.
Note that the Live templates checkbox appears in the Export Settings dialog if you have at least one custom live template in your project.
Click OK to generate the file based on live template configuration files. You can share this file with your team members, or import it on another PyCharm installation.
Import live template configuration
Choose File | Manage IDE Settings | Import Settings from the menu.
Specify the path to the archive with the exported live template configuration.
In the Import Settings dialog, select the Live templates checkbox and click OK.
After restarting PyCharm, you will see the imported live templates on the Editor | Live Templates page of the IDE settings Ctrl+Alt+S.
Thanks for your feedback!