This is the nunjucks supporting extension for vscode with complete features.
.nunjucks, .nunjs, .nj, .njk, .html, .htm, .template, .tmpl, .tpl
| Prefix | HTML Snippet Content |
|---|---|
block |
{% block name %} {% endblock %} |
{% |
{% %} |
{{ |
{{ variable }} |
extends |
{% extends "template" %} |
include |
{% include "template" %} |
filter |
{% filter filter %} {% endfilter %} |
for |
{% for item in sequence %} {% endfor %} |
asyncEach |
{% asyncEach item in sequence %} {% endeach %} |
asyncAll |
{% asyncAll item in sequence %} {% endeach %} |
if |
{% if condition %} {% endif %} |
ife |
if else |
ifel |
if elif |
elif |
elif |
else |
else |
set |
set |
macro |
macro |
import |
import |
from |
from import |
raw |
raw |
call |
call |
var |
alt variable |
super |
super |
or |
or |
pipe |
pipe |
To install extension directly from VSCode you need to proceed with theese four simple steps:
- Go to View > Command Palette (Mac OSX:
cmd+shift+P, Windows:ctrl+shift+P) - Run the following command in the Command Palette field:
>ext install extensionand hit enter. - Then type
nunjucks-vscode-extensionpackand hit enter. - After instalation is complete restart the Code app and you are all set up for start writing nunjucks templates in VSCode.
To install extension manually you need to proceed with theese five steps:
- Download this nunjucks-vscode-extensionpack repo from GitHub
- Navigate to the
<user home>/.vscode/extensionsdirectory on your computer. - Create a new folder and name it
nunjucks-vscode-extensionpack - Copy all content of this repository into the
<user home>/.vscode/extensions/nunjucks-vscode-extensionpackdirectory. - Restart the Code app and you are all set up for start writing nunjucks templates in Code.
{
"html.suggest.html5": true,
"emmet.includeLanguages": {
"njk": "html"
},
"files.associations": {
"*.njk": "njk"
}
}