我正在使用Visual Studio 2012,併爲C++文件啓用了智能縮進。 我想定製智能縮進的行爲,以便對輸入的代碼進行格式化,以符合我公司的編碼風格。Visual Studio 2012「智能」縮進自定義
如何自定義智能縮進行爲的所有微小方面?
例如,當我輸入驗證碼,它正是這樣智能縮進格式:
#include <cstdlib>
#include <string>
using namespace std;
struct Foo
{
const string mA;
const int mB;
const string mC;
Foo(const string& a,
const int b,
const string& c)
:
mA(a),
mB(b),
mC(c)
{
}
};
int main()
{
}
這其中大部分是我想要的,除了結腸引入初始化列表中,第一項初始化器列表和構造函數體的縮進級別。我想要這些格式化爲這樣,我想Visual Studio自動爲我做:
Foo(const string& a,
const int b,
const string& c)
:
mA(a),
mB(b),
mC(c)
{
}
我如何定製智能縮進的行爲?我寧願不使用任何外部工具如Visual協助十
:通過工具>選項>文本編輯器>C/C++>標籤>縮進
:我也有tabstops設置爲4,插入空格。