C++构造函数初始化列表中的vim缩进

gha*_*der 9 c++ vim

#include<iostream>
using namespace std;
class Example
{
    public:
        Example(int a,int b,int c):m_a(a),m_b(b),m_c(c)
    {  // Wrong indentation here due to the colon in above line, { should be under E
        printf("\nThe 3 argument constructor invoked\n");
    } // Wrong indentation again
    private:
        int m_a;
        int m_b;
        int m_c;
};
Run Code Online (Sandbox Code Playgroud)

大家好,

我在C++的构造函数初始化列表中的gvim缩进中遇到了一些问题.我在.gvimrc中使用了cindent,即使多次更改我的.gvimrc,我也无法解决这个问题.

一些仁慈的灵魂能给我一些方法来设置它.我试过改变cinoptions和cinwords,但没有什么真正帮助.

我在上面提供的代码段中突出显示了缩进问题.

谢谢你的耐心

关心lali

Win*_*der 1

尝试一下:set smartindent,我必须先禁用 cindent 才能使其正常工作。