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>
Code Templates Preferences

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.

Related concepts
Content Assist

Related tasks
Using Content Assist
Creating and editing code templates

Related reference
Code Templates page, Preferences window
Code Templates page

IBM Copyright Statement