In an html file, a tag is expanded using the tab key after the tag (emmet feature).
For instance, hitting tab after “h2” will yield this : <h2></h2>
.
When I’m not in an html file, like doing jsx inside a javascript file, how can I use a shortcut to yield the complete tag ?
Oh, I can select “JSX” as the file type. But the tab doesn’t work for the first tag : I have to type the full parent tag, for instance <div></div>
, then the tab will work for the children.
I’ve tried using a macro, but it doesn’t work : I recorded this : typing “h2”, select “h2”, copy, hitting “<”, so that I get “<h2>
”, then typing “</”, pasting “h2”, typing “>”, then moving back inside the tag with ctrl arrow.
When enter “h2” and apply the macro, I only get "> ", not the full “<h2></h2>
”.