I recently installed Linux with the latest version of Code::Blocks, and the way it auto formats and indents the code is HORRIBLE. I can't possibly code efficiently with an IDE like that. It worked perfectly under Windows, but its behaviour under Linux is disastrous. I tried tweaking all the options of the editor, and none of them fixes the issue.
The issue is like this...
Let's suppose I type if(k==0)
, press Enter, and then press the open brace key. Under Windows, it would auto format itself to this...
if(k==0)
{
|
}
NOTE: character '|' marks the position of the cursor.
But under Linux, it auto formats into this useless thing...
if(k==0)
{|}
Which means I need to press Enter, then Up, then Right, then Enter, and finally Tab to format it correctly...
if(k==0)
{
|
}
Basically, I have to press FIVE freaking keys after opening the braces to format the code correctly, whereas under Windows, I had to press NONE. And that's a lot of wasted time if you're in a contest.
If anyone knows how to correct Code::Blocks behaviour under Linux, please let me know. I'll greatly appreciate it.
Looks like the Gnome of Downvoting is back to mischief...
i suggest u use Sublime Text editor instead of Code::Blocks. its formatting, indentation, and text auto-completion tools are very good, and it works very well on all (Windows, Linux, and Mac) platforms.
however, AFAIK it does not have options to compile/run ur code. but since u are working on Linux, u can always use the Terminal for this.
I'm looking for an IDE that compiles the code and runs it. I always do little modifications and debug my code with print routines, so it's very slow if I compile and run from the terminal.
Thanks for the info anyway :)
Sublime text has build systems so you only need to ctrl-b when you want to compile, and the ./myexec on the nearby console window (usually you don't need even that, just press up and enter). I personally find compiling and running faster on sublime than on codeblocks, because you don't need to use mouse.
And Geany? Geany compiles and run. :)
it does: select tools Tools -> Build or just press F7.
http://docs.sublimetext.info/en/latest/reference/build_systems.html
Have you installed codeblocks-contrib package along with others? It's a contrib plugins package, and as far as I know, some indentation plugins are also put there.
I haven't installed any plugins yet. I'll give it a try to that one you named and see if it helps. Thanks for the info.
You see, indentation options that you may find in codeblocks settings like Smart Indent are in fact plugins themselves, and somewhen somewhere in my experience they wouldn't work without said package. However, I don't know whether this problem stays in current vertion of CB.
I installed the contrib plugins, and that magically solved the indentation problem! I didn't have to do anything!
Thanks a bunch!
Faced the same problem. Solved in a flash. Thanks a lot.