Paul
Paul

Reputation: 2581

Exporting Eclipse Snippets

How can I export my Eclipse Snippets so that I can re-use them on another machine?

Upvotes: 3

Views: 2644

Answers (3)

Paul
Paul

Reputation: 2581

Display the snippets view: Window -> Show View -> Other ... -> General -> Snippets

Right click in snippets view -> Customize ...

Select Snippet Category

Export

Upvotes: 6

Mikezx6r
Mikezx6r

Reputation: 16905

Depends on exactly what you mean by snippets. For Java (and other languages) you can define custom templates, as well as the default ones created by Eclipse.

In Window... Preferences, filter for templates. In the dialog on the right-hand side are buttons for import and export. Select the templates you'd like to export, and click Export...

Save them to a file.

In the other workspace, go to the same location, but do an import, and select the file you created above. This will add the saved templates to the list.

Java also has Code Templates defined (i.e. pieces of code that get put in when you create a new method, class etc). The process is similar here for import/export.

Upvotes: 2

Tim
Tim

Reputation: 2831

If you add a new snippet a wizard opens. In that window you can export your snippets!

Upvotes: 2

Related Questions