How to change brace position in IntelliJ IDE?
25,922
Solution 1
From the IntelliJ documentation:
Go to the menu File | Settings | Project Settings | Code Style - Java. Select the 'Wrapping and braces' tab. Set 'Braces placement options' to 'Next line'.
Solution 2
Here is the exact working path. I have added screenshot with explanations.
Related videos on Youtube
Author by
user3595338
Updated on September 18, 2022Comments
-
user3595338 over 1 year
I am using the IntelliJ IDEA ide for java coding. By default it produces curly braces on the same line as the function name, like so:
function bla() { .. }
Can i change it somewhere there so that i will do this instead?:
function bla() { .. }
Thanks!
-
Steve HHH almost 8 yearsI had to go to File > Settings then search for
Code Style
in IDEA 2016.1. -
Admin over 7 yearsPreferences > Editor > Code Style > Java is another route, at least in 2016.2.
-
Yar over 7 yearsdidn't worked for me (yes, I copied the new style into the Project's)
-
Toskan over 7 yearswhat i want is curly brace at end of function name and then a newline, e.g.
function foo(){ \n\n
-
Mike Chase about 4 yearsIs it possible to update existing code with new rules? This worked for me when writing new code, but not any old code. Link
-
Dr. Freddy Dimethyltryptamine almost 3 yearsDo you know how can I add these settings for languages that don't have them by default? I need to change 'wrapping and braces' for ERB file, but the only options are tab and indent size. Maybe for these languages they are inherited from somewhere? Probably yes, yes they are, inherited from Ruby of course. If someone has this problem check the "parent" language settings