Associate HTML as Jinja Files in VSCode

April 26, 2019

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.

Subscribe

I'd like to send you a weekly recap of all the articles I write as well as my take on the latest news on web development with Vue, React, Elixir/Phoenix, and others. Just fill out your email and name below!


Prev: Using Getters and Setters in Python
Next: What the heck are args and kwargs?