Visual Studio C ++ "Automatically format completed block"}

Visual Studio has this option for C #, but I cannot find it for C ++. "Automatically format completed block." "I used this function a lot when working on C # materials, and now that I am again in C ++ (which I like best), I skip this function. How can I configure this? I assume that I will have to use a third-party plugin or something in this place, but I can’t find any relevant in all my searches.

What this function does: If I have a section of code and type "{" in front of it, then type "}" after it, it will automatically add it according to the tab rules, which make reading the code easier.

Example:

Start with the code:

{ int i = 1; int j = 2; j += i; } 

Add a start bracket somewhere:

 { int i = 1; int j = 2; { j += i; } 

Add an ending bracket and the contained code will be automatically entered for me:

 { int i = 1; int j = 2; { j += i; } } 
+4
source share
1 answer

This is in Visual Studio 2013. Make sure that it is included in “Options” under “Text Editor” → “C / C ++ →“ Formatting-> General. ”The option“ Automatically format the block when you type a "".

+2
source

All Articles