Search code examples
intellij-ideaindentationline-breaks

How to setup indent size when continuing expression on new line in IDEA


Let's say we have following code (Java):

repository.add(priceStream);

But for some reason I'd like to make it in following way:

repository.add(
        priceStream);

- it has 8 spaces in the line beginning. When I place caret between "(" and "p" and press "Enter" IDEA makes 4 space-indent by default. How could I setup it?

Thanks


Solution

  • You need to adjust the value to 8 of Continuation indent in the following path:

    Settings > Editor > Code Style > File type (Ex. Java) > Tabs and indents (first tab)