# File and Code Templates

> **TL;DR**
> `File | Settings | Editor | File and Code Templates` for Windows and Linux
>
>
>
> `IntelliJ IDEA | Settings | Editor | File and Code Templates` for macOS
>
>
>
> `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) ![the Settings icon](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.settings.svg)

Use this page to view, edit, and create [file templates](using-file-and-code-templates.html).

![The File and Codes Templates page](https://resources.jetbrains.com/help/img/idea/2026.2/settings_file_code_templates.png)

| Scheme |    Select the scope to which the file templates apply:                        * Default: file templates created at the IDE level. These templates are available in all projects that you open with the current IDE instance. Use them as your personal templates that you prefer regardless of the specific project. IntelliJ IDEA stores global templates in the [IDE configuration directory](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#config-directory) under `fileTemplates`.    * Project: file templates specific for the current project. These templates are available to everyone who works on this project. IntelliJ IDEA stores them in the project folder under `.idea/fileTemplates`.    |

## Tabs

IntelliJ IDEA includes the following types of templates:

| Files |    IntelliJ IDEA uses file templates to create new files.    |
| Includes |     These are templates for reusable fragments that can be included in file templates. For more information, refer to [Reusable content in templates](parse-directive.html).                           |
| Code |     IntelliJ IDEA uses these built-in templates as snippets to generate various constructs. For example, to generate implemented or overridden methods.                            You can edit the templates available on this tab to modify how IntelliJ IDEA generates these constructs, but you cannot create new ones. To create custom code snippets, use [live templates](using-live-templates.html).     |
| Other |    These templates are related to various application servers and frameworks.     You can edit the existing templates, but you cannot create new ones.    |

## Toolbar

|  ![the Create Template button](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.add.svg) Create Template  | Create a new [file](#tabsFiles) or [include](#tabsIncludes) template. |
|  ![the Create Child Template File button](https://resources.jetbrains.com/help/img/idea/2026.2/app-client.expui.actions.addFile.svg) Create Child Template File  |  Add a child template to the selected template to create [a set of multiple files with one template](templates-with-multiple-files.html).  |
|  ![the Remove Template button](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.remove.svg) Remove Template  |  Delete the selected [file](#tabsFiles) or [include](#tabsIncludes) template. You can delete only custom templates, not the default ones.  |
|  ![the Copy Template button](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.copy.svg) Copy Template  |  Create a copy of the selected [file](#tabsFiles) or [include](#tabsIncludes) template.  |
|  ![the Revert to Original Template button](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.reset.svg) Revert to Original Template  |  Revert the selected template to its original state. You can revert only modified default templates.  |

## Template settings

| Name |    Specify the name of the template to display in the UI.                              Not available for default built-in templates.    |
| Extension |    Specify the file extension to associate the template with a specific file type.                              Not available for default built-in templates.    |
| File name |      If necessary, specify a name for the file created from this template. By default, IntelliJ IDEA prompts the user to enter a name when adding the file. You can hard-code a specific name to avoid the prompt entirely, or compose a template from available variables. For example, here is how you can use the specified name but put it one directory above the one that was selected during file creation: `../${NAME}`                                Not available for default built-in templates.    |
| Template editor |  Edit the code used for the selected template. For more information about the syntax used in file templates, see [Syntax](using-file-and-code-templates.html#syntax).  |
| Reformat according to style |      Reformat the contents generated based on this template according to the [code style](code-style.html) defined for this file type.                                This option is available only for file templates.    |
| Enable Live Templates |      Insert [live templates](using-live-templates.html) inside the file template. Use the Velocity escape syntax to include [live template variables](template-variables.html) in a file template, for example: `#[[ $MY_VARIABLE$ $END$ ]]#`      |

## See also

### Procedures

[File templates](using-file-and-code-templates.html)

