File | Settings | IDE Settings | File Templates
Ctrl+Alt+S
settings

Use this page to view, edit, create, and remove file templates.

File templates are specifications of the contents to be generated when creating a new file. They let you create the source files that already contain some initial code. File templates are written in the Velocity Template Language (VTL).

The toolbar buttons and other controls are common for all the tabs of the page.

Toolbar

ItemTooltipDescription
add.png Create TemplateClick this button to create a new template in the currently opened tab. The button is available in the Templates and Includes tabs.
delete.png Remove TemplateClick this button to delete the selected template. The button is available in the Templates and Includes tabs.
copy.gif Copy TemplateClick this button to create a copy of the selected template. The button is available in the Templates and Includes tabs.
resetProfileToDefault.png Reset to DefaultClick this button to abandon all the changes made to the selected template and restore its default state. The button is available only for modified templates.

The names of the modified templates are displayed in blue.

Controls

ItemDescription
NameIn this text box, specify the name of the selected template.
ExtensionIn this text box, specify the extension for PyCharm to detect files, where the selected template should be applied during creation.
Reformat according to styleSelect this check box, to have PyCharm reformat generated stub files according to the style defined in the Code Style dialog box.
Template textIn this text box, specify the body of the template:
DescriptionIn this text box, provide some information about the template, its predefined variables, and the way they work.

Tabs

TabDescription
Templates The tab displays the available file templates.

The HTML/HTML5/XHTML, Python script, Python Unit Test, and Setup Script templates cannot be deleted and their names and extensions cannot be edited.

JavaScript template, if unchanged, can be deleted, but the corresponding Name and Extension fields are disabled.

Includes The tab shows the templates of reusable fragments that may be included in the file templates.

See Also

Concepts:

Procedures:

Web Resources: