VS2015 Select code then hit { to enclose it in braces

That’s not turned on by default, but it appears to be found in:

Tools -> options -> Text Editor -> C/C++ -> Experimental

Text Editor section,set Enable Expand Scopes to True.

Now I don’t know if “Experimental” means it might explode or something from time to time…

6 Likes

You deserve more likes

For VS2017RC go to Advance instead of Experimental, the rest is the same

3 Likes

In VS2017 I don’t find Expand scopes, but I do find Enable Surround with Braces.

Problem is that if I set that to True it does surround comments, but it disregards indentation so everything is lined up.

Before:

After:

Helpz??

Privacy & Terms