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.
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.
... This "Language Indicator" is near the bottom-right of VS Code's window.
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
None. I don't see any change.
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!
It changes the Nunjucks into HTML5 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.
Now it goes with HTML5 format by default! 🎉🎉🎉
To change the default HTML format from Nunjucks to HTML5 in VSCode:
- Open the "HTML Nunjucks" file.
- Click the language indicator that says "HTML Nunjucks" on the right side of the Status Bar.
- Select "Configure File Association for '.html'...".
- Select HTML
Thank you, Surayya, for being there with your patience while I pulled my hair and did 1001 facial expressions 😄.
Thank you for reading!
Last but not least, you can find me on Twitter. Let's connect! 😊