Is there a keyboard shortcut in Visual Studio 2010 (I also use ReSharper 6.1) that allows me to surround the selected block of text with curly braces? I tried "Surround With ..." (Ctrl + K, Ctrl + S), but there was no choice in the list for choosing curly braces as the surrounding element. A common example of using this is that I will have an if statement, for example:
if (conditional) statement1;
I will understand that there are some additional tasks that need to be performed inside the if statement, and I add them:
if (conditional) statement1; statement2; statement3;
Then I remember that I need to wrap all the expressions in curly braces, and the code should look like this:
if (conditional) { statement1; statement2; statement3; }
What I would like to do is simply select the three operators, and then press the shortcut key to wrap them with curly braces. What I'm actually doing is moving the cursor to the beginning of the line after the conditional expression, and then entering the character {and then deleting}, which ReSharper (uselessly) automatically inserts right after {, then moving the cursor to the end of the last block instruction and input} to complete the block.
visual-studio-2010 curly-braces resharper curly-brackets
Matt Apr 05 2018-12-12T00: 00Z
source share