Gaith
Gaith

Reputation: 828

Can I change the behavior of Code::Blocks auto-indent?

I used to use Microsoft Visual Studio 2005 to write C++ code, and the behavior of auto-indent in it was very good.

But when I tried to use Code::Blocks, I realized that the behavior of auto-indent in it is awful.

for example one of the things that bother me:

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

the same thing for if and while

Is there any way to change the behavior of auto-indent in Code::Blocks so it'll be as good as Microsoft Visual Studio auto-indent?

Upvotes: 4

Views: 6639

Answers (1)

Garrett
Garrett

Reputation: 4394

First, make sure smart indent is enabled (Settings -> Editor -> Smart indent).

It still wasn't working for me on Ubuntu, but installing the codeblocks-contrib package with

sudo apt-get install codeblocks-contrib

fixed some of the problems. It fixed the smart-indenting for if, while, for, but not for classes and functions. If anyone knows how to fix the rest of problem, please let me know.

Upvotes: 11

Related Questions