So I am new to the Intellij Idea IDE and so far I like it a lot. Just having some trouble getting the code style settings exactly how I like them for Java. I am a fan of not using braces for one line if statements but I like for them to be on two lines:
if(true)
dosomething();
Right now when I run code formatting in Idea, it moves up into one line:
if(true) dosomething();
and I find that very hard to read, but I cannot seem to get the settings just right. Can anyone help me out and tell me what I need to set to keep it on two lines but still no braces? Feel pretty dumb not being able to find it. Thanks!
Press Ctrl+Home to set the caret at the beginning of the first line, enable the column selection mode (press Alt+Shift+Insert ), and then press Ctrl+Shift+End .
Deselect Simple blocks in one line
in settings -> CodeStyle -> WrappingandBraces, then it should work. It worked for me.
Have you tried Control Statements on one line? Does it for me.
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