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!

image description