在gvim中选择以下代码并点击“=”时,它会移动构造函数左侧的括号。这是一个gvim错误还是这个设置我可能要设置修复?
输出:
class GameData
{
public:
enum Key { A=0, B, C, D, TOTAL_KEYS };
GameData() : moves_() , numKeys_(TOTAL_KEYS)
{
populateMoves();
}
inline const std::vector<Key>& getMoves ( int k ) const
{
return moves_[k];
}
期望的输出:
class GameData
{
public:
enum Key { A=0, B, C, D, TOTAL_KEYS };
GameData(): moves_(), numKeys_(TOTAL_KEYS)
{
populateMoves();
}
inline const std::vector<Key>& getMoves ( int k ) const
{
return moves_[k];
}
答案 0 :(得分:1)
设置cino=i0
使用我的vim install正确对齐语句。
来自帮助
*cino-i*
iN Indent C++ base class declarations and constructor
initializations, if they start in a new line (otherwise they
are aligned at the right side of the ':').
(default 'shiftwidth').