Code block with volume braces?

Is there a shortcut to surround a given (selected) code block with curly braces?

VS 2015 + R # 2016.1

+8
visual-studio visual-studio-2015 resharper
source share
3 answers

As an alternative to Patrick's answer ( Ctrl + E , U , 7 ) you can also use the extended Alt + Enter -menu ReSharper 9 +.

Alt + Enter , UP , UP , Enter or

Alt + Enter , "bl", Enter

Screen

Unfortunately, I don't know a way to bind this to a shorter hotkey.

But if this is really important to you, you can try AutoHotkey .

+5
source share

The fastest built-in shortcut in the Visual Studio schema that I can find is Ctrl + E + U , 7 (surround with ..., then select option 7, which is the curly brace).

I don't see a shortcut for it in the Visual Studio keyboard settings, so this may be the best you can get.

+9
source share

using visual studio 2017 with resharper 2017, it seems that the way to do this is to press CTRL + E and either: Up , Up , Enter , or start typing the name label ( swb will match Surrond With block and make you happy.

I am not 100% sure if it is VS or RS, though, since CTRL + E is VS 2017.
On the plus side, you can easily find shortcuts and find new gems as soon as you press CTRL + E.

Update
This is part of Reshar. I am using 2017.1.1. You can find more voluminous with templates on your page for live templates .

+1
source share

All Articles