Visual Studio Code can give you syntax highlighting for your Jinja templates even though Jinja files are usually named with a *.html
extension in Flask projects.
I assume you already have the Python Extension for VSCode installed.
Open your Preferences > Settings
from the dropdown menu or your settings.json
file inside your current project's .vscode
directory and add:
{
"files.associations": {
"*.html": "jinja-html"
}
}
I wouldn't put this in the user settings.json
file since that will globally associate all *.html
files with jinja-html
.
Top comments (1)
How do I keep both Jinja and html formatting? When I do this, I lose the html formatting.