<html><head><link rel="canonical" href="https://www.jetbrains.com/help/idea/creating-and-registering-file-types.html.md/" data-react-helmet="true"/></head><body># File type associations

&gt; **TL;DR**
&gt; Configure: open settings by pressing `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)) and navigate to `Editor | File Types`.

For language-specific features (such as syntax highlighting and [code analysis](null)) in files representing different languages and technologies, IntelliJ&nbsp;IDEA maintains a list of file types, each of which links a language service with one or more file name patterns.

The default list of file types covers all relevant file name patterns, but you can [add new file types](#create-new-file-type) for your custom language files and [change the associated file name patterns](#change-extension) for existing file types.

&gt; **Tip:**
&gt; If you are working on a language that is not supported in IntelliJ&nbsp;IDEA by default, there might be [plugins](https://plugins.jetbrains.com/idea) supporting that language depending on the IntelliJ&nbsp;IDEA edition. The file type gets automatically associated with the plugin as soon as the plugin is correctly installed.

When you open a file in the editor, IntelliJ&nbsp;IDEA chooses the file type and the corresponding language service according to the file name pattern. If the file name does not match any of the patterns registered for file types,  you can [associate the file name pattern with a specific file type](#register-new-association).

Apart from that, you can [make IntelliJ&nbsp;IDEA the default application](#associate-files-with-ide) for opening specific file types from the file manager on your operating system.

## Add a custom file type

If you work on a language that is not supported by default and there are no [plugins](https://plugins.jetbrains.com/idea) for it, you can configure a simple language service for files associated with this language — you will enjoy syntax highlighting for keywords, comments, and braces and have some basic editor helpers such as adding line/block comments with `Ctrl+/` (Windows), `⌘ /` (macOS), `⌘ /` (IntelliJ IDEA Classic (macOS)), `⌘ /` (macOS System Shortcuts), `Ctrl+/` (XWin), `Ctrl+/` (GNOME), `Ctrl+/` (KDE), `Alt+;` (Emacs), `Ctrl+/` (Sublime Text), `⌘ /` (Sublime Text (macOS)), `Ctrl+/` (NetBeans), `Ctrl+Alt+/` (Visual Studio), `⌘ ⌥ /` (Visual Studio (macOS)), `Ctrl+/` (Eclipse), `⌘ /` (Eclipse (macOS))/ `Ctrl+Shift+/` (Windows), `⌘ ⌥ /` (macOS), `⌃ ⇧ /` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ /` (macOS System Shortcuts), `Ctrl+Shift+/` (XWin), `Ctrl+Shift+/` (GNOME), `Ctrl+Shift+/` (KDE), `Ctrl+Shift+/` (Emacs), `Ctrl+Shift+/` (Sublime Text), `⌘ ⌥ /` (Sublime Text (macOS)), `Ctrl+Shift+/` (NetBeans), `Ctrl+Shift+/` (Visual Studio), `⌘ ⌃ /` (Visual Studio (macOS)), `Ctrl+Shift+/` (Eclipse), `⌘ ⇧ /` (Eclipse (macOS)) and extending/shrinking selection according to the structure with `Ctrl+W` (Windows), `⌥ ↑` (macOS), `⌘ W` (IntelliJ IDEA Classic (macOS)), `⌥ ↑` (macOS System Shortcuts), `Ctrl+W` (XWin), `Ctrl+W` (GNOME), `Ctrl+W` (KDE), `Ctrl+Alt+W` (Emacs), `Ctrl+Shift+Space` (Sublime Text), `⌘ ⇧ A` (Sublime Text (macOS)), `Alt+Shift+.` (NetBeans), `Alt+Shift+=` (Visual Studio), `⌘ ⌥ →` (Visual Studio (macOS)), `Alt+Shift+Up` (Eclipse), `⌃ ⇧ ↑` (Eclipse (macOS))/ `Ctrl+Shift+W` (Windows), `⌥ ↓` (macOS), `⌘ ⇧ W` (IntelliJ IDEA Classic (macOS)), `⌥ ↓` (macOS System Shortcuts), `Ctrl+Shift+W` (XWin), `Ctrl+Shift+W` (GNOME), `Ctrl+Shift+W` (KDE), `Ctrl+Shift+W` (Emacs), `Ctrl+Shift+W` (Sublime Text), `Ctrl+Shift+W` (Sublime Text (macOS)), `Alt+Shift+Comma` (NetBeans), `Alt+Shift+Minus` (Visual Studio), `⌘ ⌥ ←` (Visual Studio (macOS)), `Alt+Shift+Down` (Eclipse), `⌃ ⇧ ↓` (Eclipse (macOS)).

Procedure:

1. Press `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))  to open settings and then select `Editor | File Types`.

2. In the  Recognized File Types  section, click ![the Add button](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.add.svg), specify the name of the new type, and provide a description.

3. In the  Syntax Highlighting  section, configure case sensitivity, brace matching settings, and specify ways of defining comments:

* Line comment : specify characters that indicate the beginning of a single-line comment.

* Only at line start: characters that indicate the beginning of a line comment are recognized as a comment if they are located at the beginning of a line.

* Block comment start , Block comment end : specify characters that indicate the beginning and the end of a block comment.

* Hex prefix : specify characters that indicate that the subsequent value is a hexadecimal number (for example, `0x`).

* Number postfixes : specify characters that indicate which numeric system or unit is used. A postfix is a trailing string of characters (for example, `e-3, kg`).

* Support paired braces , Support paired brackets , Support paired parens , Support string escapes : select these checkboxes to highlight paired braces, brackets, parentheses, and string escapes.

4. In the  Keywords  section, you can specify up to four lists of keywords. Keywords of each list will be highlighted differently in the editor and will be auto-completed.

5. The  Ignore case  checkbox indicates whether keywords in files of the custom format are case-sensitive.

![Creating a new file type](https://resources.jetbrains.com/help/img/idea/2026.2/custom-file-type.png)

6. You can customize colors for syntax highlighting of language-specific keywords, comments, and other identifiers on the `Editor | Color Scheme | User-Defined File Types` settings page.

&gt; **Note:**
&gt; In IntelliJ&nbsp;IDEA, recognized files are not always supplied with extensive support. For example, `.php` files are recognized in the [IntelliJ&nbsp;IDEA Community
&gt; Edition](https://www.jetbrains.com/idea/features/editions_comparison_matrix.html) and marked with the corresponding icon, although this edition does not provide PHP development support.

## Configure associations between file name patterns and file types

Procedure: Associate a file name pattern with a file type

1. If IntelliJ&nbsp;IDEA cannot identify the type of the file that you are trying to open or create, it displays the Register New File Type Association dialog where you can choose the way you want to process this file.

If the dialog does not appear automatically, right-click the file in the   Project tool window   and select Associate with File Type… from the context menu or choose `File | File Properties | Associate with File Type…` from the main menu.

2. In the Register New File Type Association dialog, select the necessary options:

![IntelliJ&nbsp;IDEA: Associating a file name pattern with a file type](https://resources.jetbrains.com/help/img/idea/2026.2/register-new-file-type.png)

3. From the File pattern list, select whether you want to specify a type for the current file (`file.extension`) or for all files with this extension (`*.extension`).

4. Select one of the following options:

* Open matching files as text and auto-detect file type by content: open the file without an extension as a text file and identify its type by the content, for example, by the shebang line.

* Open matching files in IntelliJ&nbsp;IDEA: associate the file with one of the existing file types. You can [change this association](#change-extension) later in the settings.

* Open matching files in associated application : open the file in the default system application configured in your operating system. For example, `.pdf` files are opened in the default PDF viewer. If necessary, you can [check and configure](#configure-filename-patterns-associated-with-system-applications) all file name patterns associated with system applications.

5. Click OK to apply the settings.

Procedure: Change file name patterns associated with a file type

1. Press `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))  to open settings and then select `Editor | File Types`.

2. From the Recognized File Types list, select the file type that you want to associate with other file name patterns.

3. Use the File name patterns section to make the necessary changes. You can add a new pattern (![the Add button](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.add.svg)), remove an existing one (![the Remove button](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.remove.svg)), or modify an existing pattern (![the Edit button](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.edit.svg)).

![IntelliJ&nbsp;IDEA: Change association between file type and related file name patterns](https://resources.jetbrains.com/help/img/idea/2026.2/custom-extension.png)

If your project contains files in proprietary formats, such as `.pdf` and `.docx`, IntelliJ&nbsp;IDEA will open these files using the default application configured in your operating system. When a specific proprietary file format is not recognized, or you want to open certain files with the system application, you can add the necessary associations.

Procedure: Configure file name patterns associated with system applications

1. Press `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))  to open settings and then select `Editor | File Types`.

2. In the Recognized File Types list, select  Files opened in associated applications.

3. In the  File name patterns  section on the right, click ![the Add button](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.add.svg) and specify a filename pattern that should be associated with an external application.

If a file is correctly associated with a specific file type by its file name pattern, but you want to process this file differently, you can override the file type association for this file only — other files matching that pattern will not be affected.

Procedure: Override file type for a specific file

1. In the    Project tool window   (`Alt+1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `Alt+1` (XWin), `Alt+1` (GNOME), `Alt+1` (KDE), `Alt+1` (Emacs), `Alt+1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `Ctrl+1` (NetBeans), `Ctrl+Alt+L` (Visual Studio), `⌘ ⌥ L` (Visual Studio (macOS)), `Alt+1` (Eclipse), `Alt+1` (Eclipse (macOS))) , select one or more files that should have another file type association,  right-click the selection and choose  Override File Type  .

2. From the list that opens, select a new file type.

&gt; **Tip:**
&gt; Use [speed search](speed-search-in-the-tool-windows.html) to find the required file type faster.

3. To restore the original file type association according to the file name pattern,   right-click the file or files again and select Revert File Type Override from the context menu.

![IntelliJ&nbsp;IDEA: Changing the file type from Project tool window](https://resources.jetbrains.com/help/img/idea/2026.2/change-file-type-quickly.png)

## Make IntelliJ&nbsp;IDEA the default app for specific file types

You can make IntelliJ&nbsp;IDEA the default application for opening specific file types from the default file manager on your operating system.

Procedure:

1. Press `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))  to open settings and then select `Editor | File Types`.

2. Click Associate File Types with IntelliJ&nbsp;IDEA and select the file extensions you want to open with the IDE.

![IntelliJ&nbsp;IDEA: Associating file types with the IDE](https://resources.jetbrains.com/help/img/idea/2026.2/associate-with-ide.png)

3. Click OK and close the dialog.

&gt; **Tip:**
&gt; If you are using macOS, restart your computer to apply the changes.

## Ignore files and folders

IntelliJ&nbsp;IDEA also maintains a list of files and folders that are completely excluded from any kind of processing. Out of the box, this list includes temporary files, service files related to version control systems, and so on:

```GENERIC
*.pyc;*.pyo;*.rbc;*.yarb;*~;.DS_Store;.git;.hg;.svn;CVS;__pycache__;_svn;vssver.scc;vssver2.scc;
```

Procedure: Modify the list of ignored files and folders

1. Press `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))  to open settings and then select `Editor | File Types`.

2. Switch to the Ignored Files and Folders tab.

You can add a new extension (![the Add button](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.add.svg)), remove an existing one (![the Remove button](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.remove.svg)), or modify an existing extension (![the Edit button](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.edit.svg)).

3. Apply the changes and close the dialog.

## Configure shebang commands for file types

IntelliJ&nbsp;IDEA can recognize file types by the path specified on the shebang line. A shebang is a combination of characters in a script file followed by a path to the interpreter program that should execute this script. It starts with `#!` and it is always located on the first line of a script file.

Procedure:

1. Press `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))  to open settings and then select `Editor | File Types`.

2. From the Recognized File Types list, select the file type for which you want to configure a command.

3. In the HashBang patterns area, click ![the Add button](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.add.svg) (Add HashBang Pattern).

4. In the dialog that opens, specify the pattern that the IDE will use to recognize a file type, then click OK.

5. Apply the changes and close the dialog.

![Configuring a shebang command for Perl](https://resources.jetbrains.com/help/img/idea/2026.2/shebang-pattern.png)

</body></html>