Obra Nunjucks is new. Get a free licence in exchange for an honest review. See how it works

Obra

Nunjucks for JetBrains IDEs

First-class Nunjucks templating support for IntelliJ-based editors. Free for 14 days — every feature, no card required.

Start your free 14-day trial Then $12, once · no subscription


A Nunjucks template open in a JetBrains IDE with the Obra Nunjucks plugin: syntax highlighting on {% extends %}, {% from %}, {% set %}, and {% block %} tags.
Editing a Nunjucks template with the plugin enabled.

Nunjucks, as your IDE sees it

Every token below is coloured by the same lexer that ships inside the plugin — the same four states, the same keyword tables, the same fold regions. Switch themes, collapse a block, read the edge cases.

{#
  layouts/base.njk — the page every other template extends.
  Multi-line comments fold too, down to a single placeholder.
#}
<!DOCTYPE html>
<html lang="{{ site.lang | default("en") }}">
  <head>
    <meta charset="utf-8">
    <title>{% block title %}{{ page.title }} · {{ site.name }}{% endblock %}</title>
  </head>
  <body class="page page--{{ page.kind | default("plain") }}">
    {% include "partials/header.njk" ignore missing %}

    <main id="content">
      {% block content %}{% endblock %}
    </main>

    {% block scripts %}
      <script src="/js/app.js" defer></script>
    {% endblock %}
  </body>
</html>
{% extends "layouts/base.njk" %}

{% block content %}
  <ul class="posts">
  {%- for post in posts | sort(attribute="date", reverse=true) %}
    <li class="post {{ "is-featured" if post.featured }}">
      <a href="{{ post.url }}">{{ post.title | title }}</a>
      <time datetime="{{ post.date }}">{{ post.date | date("D MMM YYYY") }}</time>

      {% if loop.index <= 3 and post.excerpt %}
        <p>{{ post.excerpt | truncate(140) }}</p>
      {% elif loop.last %}
        <p class="muted">…and {{ posts.length - 3 }} older posts.</p>
      {% endif %}
    </li>
  {%- else %}
    <li class="empty">Nothing published yet.</li>
  {%- endfor %}
  </ul>
{% endblock %}
{% from "macros/forms.njk" import field with context %}
{% import "macros/icons.njk" as icons %}

{% macro field(name, label, type="text", required=false) %}
  <p class="field">
    <label for="{{ name }}">
      {{ label }}{% if required %}<abbr title="required">*</abbr>{% endif %}
    </label>
    <input id="{{ name }}" name="{{ name }}" type="{{ type }}"
           {{ "required" if required }}>
  </p>
{% endmacro %}

{% call panel("Sign up") %}
  {{ field("email", "Email address", type="email", required=true) }}
  {{ field("password", "Password", type="password", required=true) }}
  <button type="submit">Continue {{ icons.arrow("right") }}</button>
{% endcall %}
{# Filters chain left to right; tests read like English. #}
{% set featured = posts | selectattr("featured") | list %}

{{ user.name | trim | title | default("Anonymous", true) }}
{{ cart.lines | map(attribute="total") | sum | round(2) }}
{{ tags | join(", ") | upper }}

{% if user.email is defined and user.email is not none %}
  <a href="mailto:{{ user.email | urlencode }}">Email {{ user.name }}</a>
{% endif %}

{% for n in range(1, 4) %}
  {{ n }}{{ ", " if not loop.last }}
{%- endfor %}

{% filter escape %}
  <em>Escaped by the surrounding block filter.</em>
{% endfilter %}

Try the arrows in the gutter. They mark exactly what the editor folds: the twelve paired tags — if, for, block, macro, call, filter, set, raw, verbatim, autoescape, asyncEach, asyncAll — plus multi-line {# comments #}.


Works with your JetBrains IDE


What you get

Syntax highlighting

Proper highlighting for Nunjucks tags, filters, and expressions inside .njk and .html files.

Jump to definition

-click (or Ctrl-click) on an {% include %}, {% extends %}, or {% import %} path to open the referenced template instantly.

Template-aware editing

Bracket matching and indentation that understands Nunjucks blocks.

Code folding

Collapse {% block %}, {% for %}, {% if %}, and comment sections to keep long templates readable.

Live templates

Type a short abbreviation and Tab to expand it into a full Nunjucks tag — blocks, loops, conditionals, and includes.

Autocomplete that knows Nunjucks

All 30 built-in tags, 42 filters, 26 tests, and the range, cycler and joiner globals — offered in the right place, so filters only appear after a | and tests only after is. Blocks, macros and {% set %} names you declared come up too.

Rename without grepping

Rename a macro, block or variable and every reference in the file follows. Find Usages works on them too, so you can see what a macro touches before you change it.

Your HTML keeps working

A .njk file is parsed as two trees — one for Nunjucks, one for the markup around it. Tag and attribute completion, colour previews, and CSS and JS assistance run right up to the delimiters, so <a href="{{ url }}"> is still a valid anchor to the IDE. Point the second tree at something other than HTML per project if your templates emit YAML or JSON.

Lightweight

No bloat. Install it, restart, get back to writing templates.


Fourteen days free, then pay once

Every install starts with a free 14-day trial — the whole plugin, nothing held back. Keep it and you buy it a single time on the JetBrains Marketplace — a perpetual licence, so all future updates are included. No subscription and no renewal.

Licence type

$12 once

For individual customers.

$24 once, per seat

For businesses and organisations. One licence per developer — pick the number of seats at checkout, or request a volume quote.

JetBrains handles licensing and billing. The exact terms for each licence type are on the Marketplace listing.

Start the free trial


Help & FAQ

Which IDEs are supported?

Twelve of them: IntelliJ IDEA, WebStorm, PhpStorm, PyCharm, RubyMine, GoLand, RustRover, CLion, Rider, DataGrip, DataSpell, and Android Studio. The plugin depends only on the platform, language, and XML modules, so it installs on any IntelliJ-based IDE that ships them.

How do I install it?

Open your IDE, go to Settings → Plugins → Marketplace, search for “Obra Nunjucks”, and click Install. Restart the IDE when prompted.

Which file extensions does it recognise?

Out of the box, the plugin handles .njk files. You can also associate .html, .j2, or any custom extension with the Nunjucks file type via Settings → Editor → File Types.

Why doesn’t my syntax highlighting show up?

The IDE needs to know which files to treat as Nunjucks. Open Settings → Editor → File Types, find Nunjucks in the list, and add the patterns you use — for example *.njk, *.nunjucks, or even *.html. Reopen the file and the highlighting will appear.

Does -click work for custom template paths?

Yes. The plugin resolves {% include %}, {% extends %}, and {% import %} paths against your project root. If your templates live in a subdirectory, mark it as a Resource Root and the plugin will follow paths from there.

Is there a free trial?

Yes — 14 days, with every feature unlocked. The JetBrains Marketplace runs it for you: install the plugin and the trial starts on its own, no card and no account setup. You only pay if you decide to keep it.

Is the $12 a subscription?

No. It is a one-time purchase. You keep using the version you bought for as long as you like, on as many machines as you personally use.

Do I get updates?

Yes. Bug fixes and compatibility updates for current JetBrains IDE versions are included.

Can I get a refund?

Refunds are handled through the JetBrains Marketplace under their standard refund policy. Reach out at hello@obra.studio if you run into trouble.

Where can I report a bug or request a feature?

Email hello@obra.studio with as much detail as you can: IDE version, plugin version, and a minimal template that reproduces the issue.