Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio C++ Code Formatting - return type + classname::func indentation

I am using Visual Studio 2012 for developing C++ code. I am used to format my code as follows:

void
SomeThing::DoesSomething()
{
    // brilliant code 
}

However, when using VS2012 code formatter, it always turns my code into this:

void 
    SomeThing::DoesSomething()
{
    // still brilliant
}

Is there a way to avoid this indentation of the ClassName::Func() in the line below the return type without completely turning off auto indentation?

like image 293
Wilbert Avatar asked May 27 '13 09:05

Wilbert


1 Answers

This is as close as you can get to your desired settings:

Tools -> Options -> Text Editor -> C/C++ -> Tabs -> Indenting -> Block

It doesn't turn off indentation (when you are coding at 1 tab and press enter, it will still be at 1 tab), but it stops it from indenting things for you.

Hope this helps!

like image 194
Oleksiy Avatar answered Nov 15 '22 12:11

Oleksiy