
Select the code snippet you want from the code snippet inserter, and then press Tab or Enter. Then, in the right-click context menu, select Snippet > Surround With. This shortcut leaves the text 'div' selected, making it seamlessly changeable to any desired tag. Visual Studio 2015 comes with a new shortcut, Shift+Alt+W wraps the current selection with a div. Note: These code snippets are built into Visual Studio. If you have Web Essentials installed, you can use Shift+Alt+W to surround a selection with a tag. For this to work, make sure the file you’re working on is HTML / PHP / any other file type that supports the HTML markup. These shortcuts are based on Emmet Abbreviation - a built-in feature in VS Code. To use surround-with code snippets through the context menu This way you can quickly set up the new file and focus on the rest of the code. Select the code snippet from the code snippet inserter and then press Tab or Enter.Īlternatively, you can type the name of the code snippet, and then press Tab or Enter. To use surround-with code snippets through the Edit menuįrom the Edit menu, select IntelliSense and then select the Surround With command. Alt-Right Arrow or Ctrl-Spacebar, Displays statement completion based on the current language or autocompletes word if existing text unambiguously identifies a. Select the code snippet from the code snippet list using the mouse, or by typing the name of the code snippet and pressing Tab or Enter. In the Code Editor, select text to surround. In the Visual Studio IDE, open the file that you intend to edit. To use surround-with code snippets through keyboard shortcut Surround-with code snippets are available three ways: through a keyboard shortcut, through the Edit menu, and through the right-click or context menu.

The following procedures describe how to use surround-with code snippets.
