Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>jinja2-comment-togglerNew to Visual Studio Code? Get it now.
jinja2-comment-toggler

jinja2-comment-toggler

Andrea Lombardi

|
2 installs
| (0) | Free
Toggle the visibility of comments in Jinja2 files
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

🧩 Jinja2 Comment Toggler

A lightweight VS Code extension to toggle the visibility of Jinja2 comments ({# ... #}) directly in the editor. Useful for template debugging, teaching, or simply reducing visual noise.


✨ Features

  • ✅ Toggle Jinja2 comments between:
    • Visible mode → Normal text
    • Faded mode → Low-opacity, nearly hidden
  • 🎛️ One-click toggle using the status bar button (bottom-left)
  • ⚙️ Automatic detection of common Jinja file extensions: .jinja, .jinja2, .j2
  • 🤝 Full compatibility with the Better Jinja extension:
    • Works with all enhanced jinja2 language modes:
      • jinja-html, jinja-css, jinja-scss, jinja-javascript, jinja-json, jinja-xml, jinja-yaml, jinja-markdown, jinja-txt

🚀 How to Use

  1. Open any supported Jinja file (e.g. template.jinja2, email.j2, etc.).
  2. Ensure the file is recognized as a Jinja language (jinja2, jinja-html, etc.).
  3. Click the status bar button labeled:
    • Click to hide comments
    • Click to show comments
  4. Comments wrapped in {# ... #} will toggle between faded or highlighted.

🧠 Why Use This?

Jinja2 templates often contain a lot of logic or instructional comments. This extension lets you:

  • Focus on the logic by fading comments
  • Highlight comments when teaching or reviewing code
  • Improve readability during templating work

📦 Supported File Types & Language Modes

  • File extensions: .jinja, .jinja2, .j2
  • Language modes:
    • jinja, jinja2, jinja-html
    • jinja-css, jinja-scss, jinja-javascript, jinja-json
    • jinja-xml, jinja-yaml, jinja-markdown, jinja-txt

These modes are fully supported thanks to integration with the Better Jinja extension.


🛠️ Requirements

  • VS Code 1.103.0 or later

🧪 Feedback / Issues

Have a suggestion or found a bug? Feel free to open an issue or contribute to the GitHub repo (link coming soon).


🧑‍💻 Author

Andrea Lombardi
I build small tools to solve the problems I find most annoying — this one included.


📄 License

MIT — see LICENSE file for details.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft