我可以更改Code :: Blocks自动缩进的行为吗?

时间:2013-02-05 17:00:40

标签: c++ visual-studio editor codeblocks indentation

我曾经使用Microsoft Visual Studio 2005来编写C ++代码,其中auto-indent的行为非常好。

但是当我尝试使用Code :: Blocks时,我意识到自动缩进的行为很糟糕。

例如困扰我的事情之一:

for (int i = 0; i < n; i++)
//it start from here in Code::Blocks

for (int i = 0; i < n; i++)
    //I want it to start from here like in Visual Studio

ifwhile

的内容相同

有没有办法在Code :: Blocks中更改自动缩进的行为,所以它会像Microsoft Visual Studio自动缩进一样好?

1 个答案:

答案 0 :(得分:10)

首先,确保已启用smart indent(设置 - &gt;编辑器 - &gt;智能缩进)。

在Ubuntu上我仍然没有工作,但安装了codeblocks-contrib

sudo apt-get install codeblocks-contrib

解决了一些问题。它修复了ifwhilefor的智能缩进,但不修复类和函数。如果有人知道如何解决剩下的问题,请告诉我。