Is there a way to create a 'surround with' snippet in visual studio 2010? I know how to create a replacement type of snippet. A simple surround with snippet could surround a block of text with an asp:hyperlink. Similar to the way the default 'surround with' snippets can surround a block of code with an asp:panel.
Have a look at the MSDN article on creating snippets. It should give you a good start. When you create your snippet, be sure to give it a SnippetType of SurroundsWith to make the snippet surround selected code.
SurroundsWith
For the latest Visual Studio (currently 2017), there's Code Snippets on Microsoft Docs, as well as Walkthrough: Creating a Code Snippet.
1.4m articles
1.4m replys
5 comments
57.0k users