Is there is a way to wrap a selected text block with quotes? In visual studio I have not found a extension or plugin I am just looking for a simple way to do it. Is there a way
The "Surround with" option is available in Visual Studio also without ReSharper. It doesn't contain the option to wrap in quotes. But it's possible to extend the snippets with custom wrappers. Also with double quotes. To do that:
File
and then click New
, and choose a file type of XML
.File
menu, click Save
.Save as
box, select All Files (*.*)
.File name
box, enter a file name with the .snippet
file name extension.Save
.Code
doubleQuotes
Microsoft Corporation
"
Wrap in double quotes
Expansion
SurroundsWith
selected
content
content
"$selected$"
Save the file.
Tools
-> Code Snippets Manager
.Import
and browse to the snippet you just created.My Code Snippets
and click Finish
and then OK
.To use it: Select text -> right click -> select "Surround with..." -> My Code Snippets -> doubleQoutes
Alternatively: Select text -> hit Ctrl + K, S -> My Code Snippets -> doubleQoutes
I got the idea for this solution from this answer where the author shows how to wrap code in custom html tags.