If you are using VS code then you can use this command shift + 1 and enter to auto-populate HTML Doctype in HTML or PHP.

When you will press enter it will add the following code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
</html>
Answer from Abdullah Khan on Stack OverflowVideos
If you are using VS code then you can use this command shift + 1 and enter to auto-populate HTML Doctype in HTML or PHP.

When you will press enter it will add the following code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
</html>
In VS Code,
Type ! and then press Enter
To have the basic structure I used to just write ! + tab, but now I can't do it anymore, the solutions are ! + ctrl + space then tab or writing html:5 + tab. How can I make the normal ! + tab come back?
I don't know if there's an extension that does your exact 2 steps, but here's a very way to do it in 3:
- Select a HTML tag, collapsed or not - doesn't matter.
- Press hotkey for
editor.emmet.action.wrapWithAbbreviationcommand. By default it's unset, so you need to configure it. - Enter the tag that will wrap what you selected.
A way to do it in 2 steps could be with help of snippets, perhaps. You could create a bunch of snippets for different tags, like:
"Wrap with div": {
"scope": "html",
"prefix": "wrap",
"body": "<div>$TM_SELECTED_TEXT</div>"
}
And then create a bunch of hotkey macros for first selecting the whole tag (e.g. editor.emmet.action.balanceOut) and then calling each of your snippet called with editor.action.insertSnippet and these args: { "name": "Wrap with div" }. See e.g. this answer for examples of defining macros.
So there is a way to wrap an HTML element easily with just 2 steps (after installing a vs Code extension):
So first Go into your VS code and install the extension called: "htmltagwrap".
Then you can do the magic:
1) Select the block of code you want to wrap, and -
If you are using windows press:
Alt+W.
If you are using Mac press:
option+W.
Then VS Code (and if I am not mistaken it is Emmet that-) will wrap the selected HTML element with a <p></p> tag automatically, but don't worry :p
2) Then straight away type the element you want and it will replace it.