How to automatically insert nested HTML tags in VS Code

I am trying VS Code and I used Emmet to create a new HTML element with the class. I need to create another nested (child) HTML element inside the original element, but by default VS Code will not indent the new element when you press enter inside the tags of the original element. For example, if you have <div class="main"></div>

and press Enter between tags div

, you get -

<div class="main">
</div>

      

And then you need to manually go up one line, add tabs and indentation for the new HTML element.

In Webstorm, pressing the enter button between parent tags automatically indents the new child element.

Here are two GIFs that show what I mean.

VS Code -

enter image description here

Web storm -

enter image description here

Is there an extension or some other trick that achieves this functionality in VS Code?

+6


source to share


1 answer


Press Alt + shift + f , this will automatically reverse your code.



0


source







All Articles