Search code examples
htmlvisual-studio-codenunjucks

VSCode / Auto Close in *.nunjucks


Is there a way to activate the html auto closing in *.nunjucks-files? It only works in *.html-files for me. I found no plugin for this.


Solution

  • I've dealt with this issue too. The solution I found was downloading this extension Auto Close Tag. You can configure it's "auto-close-tag.activationOnLanguage" setting to include any language, such as "nunjucks".

    It's my understanding that you need to also download a language support extension for Nunjucks. This is an extension that allows you to pick Nunjucks in Select Language Mode in VSCode. Personally, I like this one: Nunjucks by ronnidc, but you can use the one that you like.

    The only caveat is that the name for Nunjucks in VSCode (the one you see when you select language mode) needs to match up with the name you have in the "auto-close-tag.activationOnLanguage" settings. For me it's "nunjucks"; case-sensitive.