Can I change the behavior of Auto Block code?

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

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

for example, one of the things that bothers 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 

same for if and while

Is there a way to change the auto-indent behavior in Code :: Blocks so that it is as good as Auto-indent Microsoft Visual Studio?

+4
source share
1 answer

First make sure smart indent turned on (Settings → Editor → Smart Indent).

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

 sudo apt-get install codeblocks-contrib 

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

+10
source

All Articles