How can I add syntax highlighting to Nunjucks template files in IntelliJ IDEA / Webstorm?
There is no obvious plugin available. Perhaps there is something for a similar templating engine that would work?
It's a template engine with similar syntax (but for PHP). Add the custom pattern *.njk. Now all *.njk files are parsed as Twig so in the end you have support for Nunjucks. Show activity on this post. Webstorm don't has build-in TWIG support.
All of the functionality in WebStorm is available in IntelliJ IDEA Ultimate, either out of the box or via free plugins. There's no need to purchase licenses for both IntelliJ IDEA Ultimate and WebStorm unless you like having a dedicated tool for each language. Then WebStorm may be the right choice for focused JavaScript development.
Currently, it supports several Linux distributions, such as Ubuntu, OpenSUSE, and SLES. IntelliJ IDEA lets you create and open projects in the WSL file system, run, and debug applications in the WSL environment. You can also use local Windows-based projects and run the applications remotely in WSL with the run targets feature.
If you open the run configuration, note that IntelliJ IDEA refers to WSL as local machine. The results of the code execution are displayed in the Run tool window. To run Terminal in WSL configuration, open project Settings/Preference ( Ctrl+Alt+S) and go to Tools | Terminal. Type wsl.exe in the Shell path field and click Ok.
Just found a solution. Configure a custom extension with Twig files. It's a template engine with similar syntax (but for PHP).
add Twig Support plugin if necessary
Go to Settings -> Editor -> File Types and add find Twig
Add the custom pattern *.njk
.
Now all *.njk
files are parsed as Twig so in the end you have support for Nunjucks.
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