# TextMate 捆绑包

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/zh-cn/help/clion/llms.txt).

对于 CLion 不支持的多种语言，例如 PHP、Ruby 和 Java，IDE 仍然提供语法高亮功能，以便在您偶尔需要查看此类代码时提升编码体验。 有关使用 TextMate 语法描述语言的更多信息，请参阅 [TextMate 官方网站](https://macromates.com/manual/en/language_grammars)。

这些语言的语法高亮基于TextMate grammars，并且 CLion 随附了各种语言的语法文件集合。 所有可用的 bundles 都列在  `编辑器 | TextMate Bundles` 页面的   设置  对话框中（ `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)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))）。

![TextMate 捆绑包设置](https://resources.jetbrains.com/help/img/idea/2026.3/cl_textmate_settings.png)

如果通过 IDE 本身或插件（如 [Rust](https://plugins.jetbrains.com/plugin/8182-rust)）提供了对所选语言的更深入支持，则优先于 TextMate 捆绑包。

您还可以下载并 [使用自定义 TextMate 捆绑包](#importing-bundles)来支持其他语言。

当为特定语言启用 TextMate 捆绑包时，CLion 会为与该捆绑包注册的文件类型提供语法高亮。 例如，对于 Ruby：

![Ruby 语法高亮](https://resources.jetbrains.com/help/img/idea/2026.3/cl_textmate_ruby.png)

##  使用自定义 TextMate 捆绑包 

假设您希望 CLion 高亮显示 OCaml 文件的语法。 为此，您已经下载了 [OCaml TextMate Bundle](https://github.com/textmate/ocaml.tmbundle)。 它现在位于您的硬盘上，您只需将此 bundle 导入 CLion。

Procedure:

1. 在   设置  对话框( `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)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)))中，选择   编辑器 | TextMate Bundles  。

2. 点击 ![添加按钮](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.add.svg)并在您的磁盘上找到所需的捆绑包：

![选择已下载的 bundle](https://resources.jetbrains.com/help/img/idea/2026.3/ac_textmatebundles_import.png)

3. 点击   确定  以应用更改。   OCaml   bundle 出现在已识别的 bundles 列表中：

![新建 TextMate bundle](https://resources.jetbrains.com/help/img/idea/2026.3/ac_textmatebundles_import_result.png)

4. 添加 TextMate 捆绑包后，与该捆绑包注册的文件类型将提供语法高亮。 以下是一个使用我们添加的 TextMate 捆绑包的 OCaml 代码片段示例：

![代码高亮](https://resources.jetbrains.com/help/img/idea/2026.3/ac_textmatebundles_highlight.png)

## See also

