I'm having trouble with my new installed Visual Studio Code on Windows 7. On Mac the editor automatically closes html tags but on my Win7 not. I assume there must be some option to turn it on but I can't find any.
I'm talking about when eg. writing <html
the intelliSense pops up and you click enter, usually it automatically puts in the </html>
mine's not working.
(The IntelliSense pops up but when you select one of the options it doesn't auto close the tag: <h1> -> </h1>
)
From the 0.3.0 release notes
Here is a cool trick (actually an Emmet abbreviation) :
h1
h1*
<h1></h1>
)
PS: This also works for self-closing tags, such as -
input
,img
etc.File > Preferences > Keymaps, Search 'Auto close' and click on install. If it doesn't work, reload the plugin.
I was experiencing the same problem, then i saw something on my bottom right of vs code.. instead of using HTML, i was using Django-HTML, so i changed the language to html, Boom everything is working fine again.see image
You could try this extension for VS Code. It has implemented the auto close tag function and would meet with your requirement:
Type the tag name (without starting
<
) then press Tabfor example type
div
then press tab and VS will convert it to<div></div>
Or type the opening tag then press Tab twice
for example :
<div
it will add the closing tag