Creating and editing code templates

Code templates are stored in templates.xml in the org.eclipse.cdt.ui and org.eclipse.jdt.ui folders.

To create a code template:

  1. Click Window > Preferences.
  2. Expand C/C++, and click Code Templates.
  3. Click New.
    Screen capture for inserting a new Code Template
  4. Do the following:

  5. Click OK.
    The new code template is now displayed in the list.

To edit a code template:

  1. Click Window > Preferences.
  2. Expand C/C++, and click Code Templates.
  3. Click Edit. The New Template dialog box opens.
    Screen capture for editing a Code Template
  4. Do the following:

  5. Click OK.

Related concepts
Content Assist

Related tasks
Using Content Assist
Importing and exporting code templates

Related reference
Code Templates page, Preferences window
Code Templates page

IBM Copyright Statement