IntelliJ IDEA 2024.1 Help

TextMate

TextMate is a general-purpose GUI text editor for macOS.

For a number of languages that are not supported in IntelliJ IDEA, for example, Swift, C++, and Perl, the IDE still provides syntax highlighting to improve your coding experience if you occasionally need to examine such code.

Syntax highlighting for these languages is based on TextMate grammars, and IntelliJ IDEA is shipped with a collection of grammar files for different languages. All the available bundles are listed on the Editor | TextMate Bundles page of the Settings dialog (Ctrl+Alt+S) .

Enable the TextMate Bundles plugin

This functionality relies on the TextMate Bundles plugin, which is bundled and enabled in IntelliJ IDEA by default. If the relevant features aren't available, make sure that you didn't disable the plugin.

  1. Press Ctrl+Alt+S to open settings and then select Plugins.

  2. Open the Installed tab, find the TextMate Bundles plugin, and select the checkbox next to the plugin name.

Import TextMate bundles

You can also download and use custom TextMate bundles for other languages. IntelliJ IDEA provides compatibility with several types of bundles, originally designed for different editors:

  • TextMate bundles are the original bundle types for TextMate editor. They are packaged in a directory with a .tmBundle extension.

  • Sublime Text packages come with .tmLanguage and .tmPreferences files inside a directory. Since the original TextMate bundles also contain the same files, they are often used interchangeably.

  • Visual Studio Code extensions with a package.json file present in the directory.

Suppose you want IntelliJ IDEA to highlight syntax of the OCaml files.

  1. Download the OCaml TextMate Bundle. It is now on your disk.

  2. Press Ctrl+Alt+S to open settings and then select Editor | TextMate Bundles.

  3. Click the Add button and locate the OCaml bundle on your disk. It appears in the list of recognized bundles.

Test the imported bundles

Once a TextMate bundle is added, IntelliJ IDEA provides syntax highlighting for the file types supported by this bundle. Here is a sample OCaml code fragment that uses the TextMate bundle added earlier:

Add TextMate bundles
Last modified: 03 May 2024