Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>JinjaNew to Visual Studio Code? Get it now.
Jinja

Jinja

wholroyd

|
15,892,827 installs
| (17) | Free
Jinja template language support for Visual Studio Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Jinja for Visual Studio Code

This extension adds syntax highlighting and snippets for the Jinja template language.

IDE

Using

Install Visual Studio Code 1.75 or higher. In the command palette (cmd-shift-p / ctrl-shift-p) choose Install Extensions and search for Jinja.

Jinja has no single standard file extension, so the extension maps a few common ones and leaves the rest to you.

Language mode Extensions
Jinja .j2, .jinja, .jinja2
Jinja HTML .html.j2, .html.jinja, .html.jinja2
Jinja YAML .yml.j2, .yaml.j2, .yml.jinja, .yaml.jinja, .sls

Jinja HTML is a separate language from HTML. Emmet abbreviations work there because the extension maps jinja-html to HTML for Emmet. Script and style blocks use JavaScript and CSS commenting instead of HTML comments.

To treat other names as Jinja, use files.associations:

"files.associations": {
    "*.jinja": "jinja",
    "*.html": "jinja-html",
    "*.sls": "jinja-yaml"
}

Do not associate *.html globally if you also edit plain HTML in that workspace. Prefer a folder setting, or double extensions like .html.j2.

This extension does not replace VS Code's built-in HTML or YAML languages. That used to happen, and it broke commenting, Emmet, and other HTML features in every HTML file.

Contributing

Pull requests are welcome for highlighting, snippets, and language configuration. IntelliSense, go to definition, and formatters need a language server. This extension does not provide one.

If you're new to VS Code extensions, start at https://code.visualstudio.com/api.

Run npm test for grammar fixtures and a check that we still don't attach grammars to the built-in HTML or YAML languages. Pull requests run the same command in GitHub Actions.

To work on this extension:

  1. Open the Debug viewlet, select Launch Extension, and run (F5). That starts a second Code window with this folder loaded as the extension.

  2. Reload that second window (Ctrl+R or Cmd+R on Mac) after you change files.

If you already have the Marketplace build installed, the debug window uses this folder instead. Your stable window keeps the installed version.

Contributors

  • Mikhail Kashkin
  • TuxOtaku (Ryan Draga)
  • Silvenga (Mark Lopez)
  • Tim Wilde
  • Juan Castano
  • MortalCatalyst (Sayth)
  • gmotos

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft