問題描述
在 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 來實現(xiàn)這一點?
Is there any way to achieve this using anything (I've got ReSharper and Highlighter) or perhaps vanilla VS?
推薦答案
與內(nèi)置的 Visual Studio 編輯器設(shè)置最接近的是將縮進模式從智能"更改為塊"(工具 -> 選項-> 文本編輯器 -> 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).
當(dāng)你這樣做時,你可以隨意縮進任何你喜歡的東西,你只是失去了自動縮進".基本上,每當(dāng)您按 [enter] 時,新行都會縮進與前一行相同數(shù)量的制表位/空格,并且不會自動重新格式化行以使它們對齊.
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.
這篇關(guān)于Visual Studio 2010 中的 C++ 訪問修飾符自動縮進慢慢讓我發(fā)瘋 - 可以更改嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!