Visual Studio 2010 中的 C++ 访问修饰符自动缩进慢慢让我发疯 - 可以更改吗?

在 Visual Studio 中编程 C++ 时,它坚持在访问修饰符上给我这些可怕的缩进 - 如果有人真的喜欢这种方式,我表示哀悼;)(开玩笑的伙计们!)

When programming C++ in Visual Studio, it insists on giving me these awful indentations on access modifiers - my condolences if anyone actually likes them this way ;) (a joke folks!)

public class MyClass
{
public:
   MyClass();
   ~MyClass();
   int wowAnInt();
}

不用说,我想要这个:

public class MyClass
{
    public:
       MyClass();
       ~MyClass();
       int wowAnInt();
} 


有什么方法可以使用任何东西(我有 ReSharper 和 Highlighter)或香草 VS 来实现这一点?


Is there any way to achieve this using anything (I've got ReSharper and Highlighter) or perhaps vanilla VS?

推荐答案

与内置的 Visual Studio 编辑器设置最接近的是将缩进模式从智能"更改为块"(工具 -> 选项-> 文本编辑器 -> C/C++ -> 制表符 -> 缩进).

The closest you can get with the built-in Visual Studio editor settings is to change the indenting mode from "Smart" to "Block" (Tools -> Options -> Text Editor -> C/C++ -> Tabs -> Indenting).

当你这样做时,你可以随意缩进任何你喜欢的东西,你只是失去了自动缩进".基本上,每当您按 [enter] 时,新行都会缩进与前一行相同数量的制表位/空格,并且不会自动重新格式化行以使它们对齐.

When you do this, you can indent anything however you like, you just lose the "automatic indenting." Basically, whenever you press [enter] the new line will be indented the same number of tab stops / spaces as the previous line and it won't automatically reformat lines to get them to line up.

相关文章