htmltagwrapThis VS Code extension wraps your text selection in HTML tags. It can wrap inline selections and selections that span multiple lines (works with both single selections and multiple selections at once). To use, select one or many chunks of code and press "Alt + W" ("Option + W" for Mac). Download it on the Visual Studio Marketplace How to Use It
By default, pressing spacebar will deselect the closing tags, so you can add attributes to the opening tags (you can turn this feature off, see below). If nothing is selected when you run htmltagwrap, it will add an opening and closing tag at the cursor position. NOTE: This extension works best in files that either use tabs or spaces for indentation. It may not work as well with mixed tabs/spaces. SettingsYou can change the default behavior of htmltagwrap with the following settings. To open VS Code settings, click the "gear" icon > then "Settings" Available settings
Defaults
Keyboard shortcutIf htmltagwrap's keyboard shortcut conflicts with another command (i.e. 1) Change htmltagwrap's keyboard shortcut
OR... 2) Change the other keyboard shortcut(s)Do the same as above, except in the "Search Keybindings" text field copy and paste in See VS Code's Keybindings doc for more info. Known IssuesWhen using the default setting
I haven't found good solutions to these issues using the current extension API. ContributingPlease create an issue on GitHub if you experience a bug. I also welcome pull requests. |