# Handlebars and Mustache

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/ruby/2026.3/llms.txt).

> **TL;DR**
> Required plugins:
>
>
>
> `JavaScript and TypeScript`, `Handlebars/Mustache` -    the plugins are bundled with RubyMine and enabled by default.

With RubyMine, you can use [Handlebars expressions and Mustache templates](http://handlebarsjs.com/) in `hbs` or `mustache` files. RubyMine processes contents of such files according to default or custom settings specified on the [Templates page](null) of the Settings dialog.

## Before you start

Procedure:

1. Make sure the  JavaScript and TypeScript plugin is enabled in the settings.  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` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Meta+Comma` (TextMate), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Plugins`.  In the search field, type JavaScript and TypeScript. For more information about plugins, refer to [Managing plugins](managing-plugins.html).

2. Install and enable the Handlebars/Mustache plugin on the Settings | Plugins page, as described in [Installing plugins from
JetBrains Marketplace](managing-plugins.html#install_plugin_from_repo).

## Configuring Handlebars and Mustache in RubyMine

Procedure:

1. In the Settings dialog (`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` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Meta+Comma` (TextMate), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))) , go to `Languages & Frameworks | JavaScript | Templates`.

2. On the [Templates page](null) that opens, switch to the  Handlebars/Mustache  area.

3. To automatically insert the second closing curly brace `}` of a Handlebars expression on typing the first closing one, select the Automatically insert closing tag checkbox.

RubyMine also recognizes triple stashes `{{{` that prevent escaping values inside expressions. In this case, RubyMine automatically inserts two closing curly braces as soon as you type the first closing one.

4. To automatically reformat Handlebars expressions and Mustache templates on code generation, refactoring, or pressing `Ctrl+Alt+L` (Windows), `⌘ ⌥ L` (macOS), `⌘ ⌥ L` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ L` (macOS System Shortcuts), `Ctrl+Alt+L` (XWin), `Ctrl+Alt+L` (GNOME), `Alt+Shift+L` (KDE), `Ctrl+Alt+L` (Emacs), `Ctrl+Alt+L` (Sublime Text), `⌘ ⌥ L` (Sublime Text (macOS)), `Ctrl+Alt+Enter` (Visual Studio), `⌘ ⌥ ⏎` (Visual Studio (macOS)), `Ctrl+Q` (TextMate), `Alt+Shift+F` (NetBeans), `Ctrl+Alt+L` (Eclipse), `⌘ ⇧ F` (Eclipse (macOS)), select the Enable formatting checkbox. Otherwise, RubyMine always keeps their original formatting.

5. Choose the language to use the style for comments from. When you enter a line or block comment by pressing `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+Alt+/` (Visual Studio), `⌘ ⌥ /` (Visual Studio (macOS)), `Meta+/` (TextMate), `Ctrl+/` (NetBeans), `Ctrl+/` (Eclipse), `⌘ /` (Eclipse (macOS)) or `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+/` (Visual Studio), `⌘ ⌃ /` (Visual Studio (macOS)), `Ctrl+Shift+/` (TextMate), `Ctrl+Shift+/` (NetBeans), `Ctrl+Shift+/` (Eclipse), `⌘ ⇧ /` (Eclipse (macOS)), RubyMine inserts the comment delimiters that are used in the chosen language, for example:

* `{{!----}}` for Handlebars

* `/**/` for JavaScript

* `<!---->` for HTML

6. To configure Handlebars/Mustache-aware syntax highlighting,   in the Settings dialog (`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` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Meta+Comma` (TextMate), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))) , go to `Editor | Color Scheme | Handlebars/Mustache`. Select the color scheme, accept the highlighting settings inherited from defaults or customize them as described in [Configuring Colors and
Fonts](configuring-colors-and-fonts.html).

## See also

### Language and Framework-Specific Guidelines

[Style Sheets](style-sheets.html)

### External Links

[http://mustache.github.io/](http://mustache.github.io/) [http://handlebarsjs.com/](http://handlebarsjs.com/)

