CLion 2021.1 Help

TextMate bundles

For a number of languages that are not supported in CLion, for example, PHP, Ruby, and Java, the IDE still provides syntax highlighting to improve your coding experience if you occasionally need to examine such code. To learn how to describe languages using the TextMate grammar, see the TextMate official website.

Syntax highlighting for these languages is based on TextMate grammars, and CLion 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/Preferences dialog Ctrl+Alt+S.

TextMate bundles settings

If more profound support for a chosen language is provided through the IDE itself or a plugin (like Rust ), it’s prioritized over a TextMate Bundle.

You can also download and use custom TextMate bundles for other languages.

When a TextMate bundle for a particular language is enabled, CLion provides syntax highlighting for the file types registered with the bundle. For example, in case of Ruby:

Ruby syntax highlighting

Using a custom TextMate bundle

Suppose you want CLion to highlight syntax of the OCaml files. For this purpose, you have already downloaded the OCaml TextMate Bundle. It now resides on your hard disk, and you only have to import this bundle into CLion.

  1. In the Settings/Preferences dialog Ctrl+Alt+S, select Editor | TextMate Bundles.

  2. Click the Add button and locate the desired bundle on your disk:

    Select the downloaded bundle
  3. Click OK to apply the changes. The OCaml bundle appears in the list of recognized bundles:

    New TextMate bundle
  4. Once a TextMate bundle is added, syntax highlighting is available for the file types registered with the bundle. Here's a sample OCaml code fragment that uses the TextMate bundle we have added:

    Code highlighting
Last modified: 08 March 2021