Tips & Tricks

30 Days with IntelliJ IDEA. Code Style and Formatting

It’s a great tradition to learn new things about your favourite IDE each week. Just to keep it going we publish this article from our 30 Day Guide about fundamental features of IntelliJ IDEA. Today we will talk about the code style and how the IDE can help you with that.

As you know, code style defines how your code looks in terms of indents, spaces, wrapping, blank lines, and statements order. Consistent code style helps to make it easier for your team to read and understand it. IntelliJ IDEA provides built-in tools that help you configure code style for your project and apply it to the code automatically.

Did you know?

Did you know that in addition to Reformat code IntelliJ IDEA also provides Auto-Indent Lines action? This action helps you to correct indents for the current line and sometimes is a better option than Reformat Code because it does not require you to select anything. Just press Alt + Ctrl + I (Alt + Cmd + I for Mac) shortcut and it will quickly fix indents for the current line.

Read the complete article to learn more on the code style and formatting in IntelliJ IDEA.

Develop with Pleasure!

Comments below can no longer be edited.

2 Responses to 30 Days with IntelliJ IDEA. Code Style and Formatting

  1. Avatar

    meo says:

    July 29, 2013

    Maybe relevant: I discovered that it is really good to customize Darcula Java colors so I can easily see called inherited methods, method parameters, reassigned parameters, enums…

  2. Avatar

    Luca says:

    January 5, 2017

    Why did you do that ?
    Who would only want to indent ONE line so much that you made a shortcut for that, and not for all the file ?

Discover more