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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With