How To Change HTML Default Format From Nunjucks To HTML5 In VSCode

Ayu is a tech blogger, open source contributor & maintainer, and tech community enthusiast based in the Netherlands. She loves photography and iced coffee!
Search for a command to run...

Ayu is a tech blogger, open source contributor & maintainer, and tech community enthusiast based in the Netherlands. She loves photography and iced coffee!
No comments yet. Be the first to comment.
Hi friends π, I've been writing tech blog posts for a few years now. If you don't know me yet, English is my second language. My mother tongue is Indonesian, and I'm also surrounded by Dutch every da

I frequently receive messages from enthusiastic contributors who have completed 2 or 3 high-quality pull requests (PRs) in just 1 month. Theyβre proactive, their work is top-tier, and theyβve handled

A few months ago, I shared a story about building an automated open source portfolio using just my smartphone and an AI assistant while on vacation. My main goal was to stop the "spreadsheet struggle"

Recently, I read Bekah Hawrot Weigelβs blog post, "When 'Local' Went Global: The Pandemic Era of International Communities." As someone active in many online communities, I found it a bit sad, but I agree with her points and think they apply to open ...

Hacktoberfest is almost over. How has your contribution journey been so far? Are you confident about contributing to open source projects, or are you still struggling to find your way? If you're new to open source and still feel overwhelmed, that's c...

Hello Fellow Codenewbies π
One day I followed a tutorial to create an index.html file and saved it in Nunjucks format.
I honestly don't remember if I changed anything in settings.json when I followed along with the tutorial.
To cut the story short, since then every time I create an HTML file, by default, it would automatically be in Nunjucks format.

As I normally do, I googled to find solutions.
And I found the only solution out there.
It's written here that:
You can switch back to HTML by clicking on the word "Nunjucks" in VS Code's status bar.
Also,
... This "Language Indicator" is near the bottom-right of VS Code's window.
I got back to my VSCode, and this was how it showed.

The Nunjucks indicator was not on the right, but on the left of the Status Bar.
I thought, "Okay. Maybe there was a typo in the solution."
So I clicked it and it directed me to this tab.

As you can see, by default the HTML is already enabled, while Nunjucks is disabled!
What's going on then?
I searched if any setting for HTML was changed in the settings.json file.
None. I don't see any change.
I also searched by keyword "nunjucks" in the file.
And I only got these lines of Nunjucks in my setting, which assured me that Nunjucks is not set as the default format for HTML.

Great!
I successfully pulled my hair at this point.
I was thinking to either reinstall the VSCode or reset the whole settings.
The solution gives a link to the official documentation from VSCode.
It's written there:
... the language indicator - which is located on the right hand of the Status Bar.
So the language indicator is on the right side of the Status Bar. It wasn't a typo.
But there is nothing on the right side.
"Let's try one more time before I reinstall VSCode or reset the whole settings", I said to myself.
I deleted the HTML file and created a new one.
This time, while the file was still opened, I finally see "HTML Nunjucks" on the right side!

I clicked it and it gives me a dropdown menu.
"HTML Nunjucks (nunjucks)" is the configured language.

So I selected the HTML and voilΓ !

It changes the Nunjucks into HTML5 format! π
Next, I created a post.html file.
But wait...
Why it gets back to the Nunjucks format?

Apparently, with this solution, I need to do the whole step every time I create a new HTML file π.
Confused, I decided to do a trial and error.
Nothing to lose. I will definitely reinstall VSCode or reset my whole settings if this one failed.
Again, I clicked the language indicator.
When it shows the dropdown, I selected the "Configure File Association for '.html'...".

And I chose HTML.

I created another file called about.html.
And yes!

Now it goes with HTML5 format by default! πππ
To change the default HTML format from Nunjucks to HTML5 in VSCode:
Author's Note:
Thank you, Surayya, for being there with your patience while I pulled my hair and did 1001 facial expressions π.