Exporting and importing Live Templates in JetBrains Rider
source link: https://alexanderzeitler.com/articles/exporting-and-importing-jetbrains-rider-livetemplates/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Exporting and importing Live Templates in JetBrains Rider
I love JetBrains Rider and I'm using it on every Platform: Xubuntu, macOS and Windows. That's great a great experience but sharing Live Templates between the platforms is a bit tricky.
Things might be easier if you're using JetBrains sync but I'm using the repository sync for ages now....
The obvious option might be to use the "Save" button in the "Live Template" settings. However, if this would work, I wouldn't write this post.
The aforementioned option only export none .NET live templates.
So how do we do it for C# (and F# I guess)?
Exporting
First, open the "Manage Layers" dialog - I'm doing this via the Actions Panel (double shift keyboard shortcut). Then right click "This computer" (or where ever you want to export the live templates from) and select "Export to File...":
Then tick the checkbox "Live Templates":
Next, assign a file name and you're done with exporting.
Importing
Bring up the "Manage Layers" dialog again and select "Import from" ➡️ "Import from File..."
Select a file containing exported Live Templates:
Tick the "LiveTemplates" checkbox
And we're done 💥️
Just double check the templates have been imported:
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK