Associate HTML as Jinja Files in VSCode

Fri Apr 26 2019

Photo by Claudya Novery on Unsplash

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.

If you found the post helpful and would like this same content delivered to you,

Subscribe to my newsletter