Nunjucks for Visual Studio Code
Nunjucks template syntax definition specifically for Microsoft Visual Studio Code.
>ext install extension nunjucks
vscode-nunjucks support these file extensions
.nunjucks, .nunjs, .nj, .njk, .html, .htm, .template, .tmpl, .tpl
Although you are free to use any file extension you wish for your Nunjucks template files, the Nunjucks community has adopted
Install Nunjucks from Visual Studio Code (recomended method)
To install the Nunjucks extension directly from Visual Studio Code you need to proceed with theese four simple steps:
- Go to View > Command Palette (Mac OSX:
- Run the following command in the Command Palette field:
>ext install extensionand hit enter.
- Then type
nunjucksand hit enter.
- After instalation is complete restart the Code app and you are all set up for start writing Nunjucks templates in Visual Studio Code.
Or install the Nunjucks extension for Visual Studio Code manually
To install Nunjucks manually for Visual Studio Code you need to proceed with theese five steps:
- Download this vscode-nunjucks repo from GitHub
- Navigate to the
<user home>/.vscode/extensionsdirectory on your computer.
- Create a new folder and name it
- Copy all content of this repository into the
- Restart the Code app and you are all set up for start writing Nunjucks templates in Code.
What's in the folder
- This folder contains all of the files necessary for the vscode-nunjucks extension
package.json- this is the manifest file in which the language support is declared and the location of the grammar file that has been copied into the extension is defined.
syntaxes/nunjucks.tmLanguage- this is the Text mate grammar file that is used for tokenization
nunjucks.configuration.json- this the language configuration, defining the tokens that are used for comments and brackets.
For more information
This extension is based on the Sublime-nunjucks language file.