2

Is there a way to change VS2010 indentation rules for C++?

Basically I just want to remove the automatic indentation for the contents of a namespace.

From:

namespace name {
    //contents automatically indented
    class MyClass
    {
        //...
    };
}

to

namespace name {

//contents automatically indented
class MyClass
{
    //...
};

}
Luchian Grigore
  • 253,575
  • 64
  • 457
  • 625
Vargas
  • 2,125
  • 2
  • 33
  • 53

1 Answers1

1

Yes there is a macro available, and judging from the positive feedback, it is working well. The code is here.

Once installed the Macro can be accessed in the Macro Explorer (Tools->Macros->Macro Explorer). This is not available for the VS Express Editions.

Other basic Formatting Options are available under Tools > Options > Text Editor > C++ > Formatting

Community
  • 1
  • 1
Lorenz Lo Sauer
  • 23,698
  • 16
  • 85
  • 87