# Importing and exporting code templates

You can import and export code templates.

Note: A code template must be an .xml file formatted as follows:

    <?xml version="1.0" encoding="UTF-8" ?>
    <templates>
    <template name="author" description="author name" context="C" enabled="true">author ${user}</template>
    </templates>

To import a code template

1. Click Window > Preferences.
2. Expand C/C++, and click Code Templates.
3. Click Import.
4. Select the template file that you want to import.
5. Click OK.
   The code template list is updated to include the template that you imported.

To export a code template

1. Click Window > Preferences.
2. Expand C/C++, and click Code Templates.
3. Select the templates that you want to export and click the Export... or Export All... button. The Exporting x dialog opens where x is the number of code templates that you are exporting.
4. In File name box, type the path where you want your code templates file to be saved.
5. Click Save.
   The templates.xml file containing the code templates you exported is saved in your file system.

Content Assist

Using Content Assist
Creating and editing code templates

Code Templates page, Preferences window
Code Templates page