Safe X3 Editor Templates

The Opens the Templates preference page Safe X3 Studio > Editor > Templates preference page allows to create new and edit existing templates. A template is a convenience for the programmer to quickly insert often reoccurring source code patterns.

The following buttons allow manipulation and configuration of templates:

Action

Description

New...

Opens the Template dialog to create a new template.

Edit...

Opens the Template dialog to edit the currently selected template.

Remove

Removes all selected templates.

Restore Removed

Restores any preconfigured templates that have been removed.

Revert to Default

Restores any preconfigured templates to their default. This does not modify user-created templates.

Import...

Imports templates from the file system.

Export...

Exports all selected templates to the file system.

Templates can contain template variables. When a template is called, variables are replaced by their values. These variables are:

  • ${cursor}: specifies the cursor position when the template edit mode is left. This is useful when the cursor should jump to another place than to the end of the template on leaving template edit mode.
  • ${user}: current user.
  • ${x3user}: X3 user name (project's one).
  • ${date} : current date.
  • ${datedmy} : current date (day, month, year).
  • ${datemdy} : current date (month, day, year).
  • ${dateymd} : current date (year, month, day).
  • ${year} : current year.
  • ${time} : current time.
  • ${dollar} : dollar symbol.
  • Templates are inserted using content assist key (Ctrl+Space).