Question is pretty much in the title. Does IntelliJ have native syntax highlighting for .jinja
and .j2
files?
If not is there a plugin?
This plugin: https://plugins.jetbrains.com/plugin/7792-yaml-ansible-support offers some support for jinja
files.
To ensure that this plugin is associated with jinja
files:
File > Preferences > Editor > File Types
Recognized File Types
scroll down to YAML/Ansible
and select itUnder Registered Patterns
click the +
icon and enter *.jinja
.
With this configuration in place your jinja
files will open into this plugin. If they do not, then jinja files
must be already associated with one of the other Recognized File Types
in which case you'll need to scroll through them to find the culprit and remove *.jinja
from its Registered Patterns
.
With recent version of Intellij, you don't need any plugin any more.
Recognized Files Types
, choose Jinja 2 Template
File Name Patterns
add *.j2
for jinja2, and/or *.jinja
for jinjaFor Ansible yaml jinja 2 templates:
Recognized Files Types
, choose YAML/Ansible
File Name Patterns
add *.yaml.j2
and *yml.j2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With