13.7.2. Creating templates

You can create your own templates, or modify an existing template, in an editor and then save the newly-created file. When saving your own templates you must use the .tpl extension.

A template takes the format:

”templatename” TEMPLATE [-above|-below|-indent|-selection]
            [-auto=<phrase>] [filename]
“templatename” END



Specifies the template name.


Use this to insert the template on the line above the current cursor.


Use this to insert the template on the line below the current cursor.


Templates are indented to match the previous line.


Indicates that the template contains variables that are replaced on insertion into the source code. Valid variables are:


The currently selected text.


The current paste buffer.


The current filename, without the path, in lowercase.


The current filename, without the path, in uppercase.


The path without the filename.


Specifies the auto insertion phrase. The phrase is a name associated with a defined template. When a template has an auto insertion phrase, there are three actions available after typing in the phrase:


Insert the template at the cursor position.


View the definition of the template specified by phrase.


Invoke the Insert Template dialog.


Specifies the file containing text to define the template. Where no file is given, the lines following the template definition header are used until the line “templatename” END is reached.

Within the template, you can place a ^L (ASCII 12) character after a comment section. The lines immediately preceding the ^L are not inserted. These lines are used for data definitions.

You can also nest templates within templates using the syntax:

“filename” INCLUDE

Copyright © 2003, 2004 ARM Limited. All rights reserved.ARM DUI 0234B