The formatting shortcuts in Intellij IDEA are :

  • For Windows : Ctrl + Alt + L
  • For Ubuntu : Ctrl + Alt + Windows + L
  • For Mac : ⌥ (Option) + ⌘ (Command) + L
Answer from axelrod on Stack Overflow
🌐
JetBrains
jetbrains.com › help › idea › reformat-and-rearrange-code.html
Reformat code | IntelliJ IDEA Documentation
3 weeks ago - Reformat your code (Ctrl+Alt+L). IntelliJ IDEA will reformat your code in accordance with the current style settings, keeping existing formatting for the rules which you've selected.
Discussions

Making auto format line up with IntelliJ formatting?
I assume you're talking about the Java formatter here. The Java extension uses Eclipse libraries, so the formatter is configured using Eclipse formatter preferences (a list of available formatter preferences can be found here ). Since Eclipse formatter preferences are not the same as IntelliJ formatter preferences, you'd have to configure each rule manually until it matches what you want (if you want a GUI, you'll need to edit the preferences in the Eclipse IDE). The alternative would be some kind of automatic conversion tool. Eclipse formatter preferences can be converted to IntelliJ preferences, but not vice versa . Another option would be to use some established formatter options that are already available in both the Eclipse and IntelliJ format, such as Google Java Style Guide . More on reddit.com
🌐 r/vscode
6
1
November 2, 2021
Formatting Code
Changing the formatting of code in Eclipse to match the formatting used in IntelliJ IDEA can be done by configuring the code style settings in Eclipse to match those of IntelliJ IDEA. Here are the general steps to achieve this: **Install a Formatter Plugin (Optional):** - There are some Eclipse plugins available that can help you format your code according to IntelliJ IDEA's style. One such plugin is the "Eclipse Code Formatter" plugin, which can be found in the Eclipse Marketplace. **Configure Eclipse Code Formatter:** - If you've installed the Eclipse Code Formatter plugin or a similar tool, configure it to use the IntelliJ IDEA code style. - In Eclipse, go to `Window` > `Preferences`. - Expand `Java` > `Code Style` in the left-hand menu. - Click on `Formatter`. - You can create a new profile or edit an existing one. - In the Formatter Profile window, you can define your formatting preferences to match IntelliJ IDEA's style. This may include settings like indentation, brace placement, and more. **Import IntelliJ IDEA Code Style Settings:** - If you have access to IntelliJ IDEA, you can export its code style settings and import them into Eclipse. - In IntelliJ IDEA, go to `File` > `Settings` (or `IntelliJ IDEA` > `Preferences` on macOS). - In the settings dialog, navigate to `Editor` > `Code Style`. - Select your desired code style (e.g., Java) and customize it if needed. - Click the "Export" button to save the code style settings to an XML file. **Import IntelliJ IDEA Code Style into Eclipse:** - Back in Eclipse, under `Window` > `Preferences`, expand `Java` > `Code Style`. - Click on `Formatter`. - In the Formatter Profile window, click the "Import" button. - Browse to the XML file you exported from IntelliJ IDEA and import it. **Apply the IntelliJ IDEA Code Style:** - After importing the settings, you can apply the IntelliJ IDEA code style to your Java files. - Select the Java file(s) you want to format or use it globally for all files. - Right-click on the selected file(s) or folder and choose `Source` > `Format`. **Save the Preferences:** - To make sure your settings are saved, click "Apply" and then "OK" in the Preferences dialog. Keep in mind that Eclipse and IntelliJ IDEA may have some differences in their code formatting options, so achieving an exact match may not always be possible. You may need to make some manual adjustments or compromises to get as close as possible to your desired code style. Additionally, you may need to install additional plugins or extensions in Eclipse to fully match the IntelliJ IDEA experience, as some features may not be available out of the box. More on reddit.com
🌐 r/eclipse
1
0
September 5, 2023
I want to sort my code
What you want is search a symbol (a function name is a symbol) https://www.jetbrains.com/help/idea/searching-everywhere.html Inside a class, you can also open the structure as popup and filter it by name. In this popup, the symbol order can be chosen. https://www.jetbrains.com/help/idea/viewing-structure-of-a-source-file.html More on reddit.com
🌐 r/IntelliJIDEA
10
4
October 11, 2025
Intellij finally has a built in "Reformat code and organize imports" save action in 2021.2

It automatically saves, so usually I just use the reformat code shortcut (rather than using save and have auto format in other IDEs)

More on reddit.com
🌐 r/IntelliJIDEA
4
16
July 28, 2021
🌐
JetBrains
blog.jetbrains.com › home › intellij idea › how to format java code
How to Format Java Code - The JetBrains Blog
June 6, 2024 - For example, if we want for loops to also have curly braces, we can highlight a for loop, press Alt+Enter (Windows/Linux) or ⌥⏎ (macOS), and select Adjust code style settings. IntelliJ IDEA will display only the settings that apply to this bit of code. We can experiment with these settings and see the changes previewed live in our code.
🌐
Medium
medium.com › @AlexanderObregon › intellij-ideas-code-style-features-creating-consistent-and-clean-code-bd1c32df8285
IntelliJ IDEA: Clean & Consistent Code | Medium
April 29, 2024 - IntelliJ IDEA allows you to configure the coding style according to your preferences or team standards. Go to File > Settings > Editor > Code Style. Here, you can set rules for different languages.
🌐
JetBrains
jetbrains.com › guide › java › tutorials › reading-code › formatting
Formatting - JetBrains Guide
March 1, 2024 - If we encounter code that is not properly formatted, we can have IntelliJ IDEA reformat the code for us. In the file you want to reformat, use the shortcut ⌘⌥L (macOS) / Ctrl+Alt+L (Windows/Linux).
🌐
JetBrains
jetbrains.com › help › idea › code-style.html
Code style and formatting | IntelliJ IDEA Documentation
February 11, 2024 - IntelliJ IDEA offers two ways of defining code style rules. You can use code style schemes: groups of settings that you can configure using the IDE interface, export, and share with other members of your team. Schemes are especially useful when you need to change the default code style settings for several projects at once. For more information, refer to Code style schemes.
🌐
CodeGym
codegym.cc › java blog › random › intellij idea: coding style and code formatting
IntelliJ IDEA: Coding style and code formatting
December 19, 2023 - To make a "custom" scheme, use the button on the right to make a copy and give it a name, for example: CodeGym Then that we can import or export the settings: Another option is to import IDEA settings: A third option is the Settings Repository. To use the Settings Repository, see the IntelliJ IDEA Help documentation for more details at the following link: Settings Repository". Speaking of pushing a unified style on a team, I also can't help but mention the good support for styles from the Eclipse IDE. To do this, you need to install a separate plugin: open IDEA settings via File -> Settings (Ctrl+Alt+S) and go to the "Plugins" section.
Find elsewhere
🌐
YouTube
youtube.com › intellij idea, a jetbrains ide
IntelliJ IDEA coding tips - reformat - YouTube
#intellijidea #intellij #java #jetbrains #programming #shorts
Published: November 24, 2023
Views: 2K
🌐
JetBrains
jetbrains.com › help › idea › configuring-code-style.html
Code style schemes | IntelliJ IDEA Documentation
4 weeks ago - To configure a scheme for new projects, go to File | New Projects Setup | Settings for New Projects | Editor | Code Style in the main menu. Select the code style Scheme that you want to copy: the Project scheme or one of the IDE-level scheme. Click the Show Scheme Actions icon and select one of the following options: Copy to IDE… (for the Project scheme): copy the selected scheme to the IDE level. IntelliJ IDEA saves the new code style with the specified name to the IntelliJ IDEA home directory.
🌐
YouTube
youtube.com › watch
How to format code in Intellij IDEA - YouTube
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
Published: January 5, 2016
🌐
YouTube
youtube.com › watch
How to format code in Intellij - YouTube
how to format java code in intellijHow to format code in Intellij#intellij #intellijidea
Published: May 9, 2025
🌐
IQCode
iqcode.com › code › other › reformat-intellij
reformat intellij Code Example
October 18, 2021 - // Mac CMD + Option + L // Windows Ctrl + Alt + L
🌐
EDUCBA
educba.com › home › software development › software development tutorials › software development basics › intellij format code
IntelliJ Format Code | How to Create IntelliJ Formatting Code?
February 17, 2023 - IntelliJ IDEA assists you with keeping up with the expected; IntelliJ helps us format code as per rules, so IntelliJ provides the two types of schemes. We can design utilizing the IDE connection point, commodity, and offer with different colleagues. Plans are precious when you want to change the default code style settings for a few ventures on the double. When the principles are designed, you can conjure the Reformat code activity that changes the organizing of your code in the chosen code part, inside a document, or across your whole task.
Address: Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
JetBrains
jetbrains.com › help › idea › prettier.html
Prettier | IntelliJ IDEA Documentation
1 month ago - From the Prettier package list, select the prettier installation to use. If you followed the standard installation procedure, IntelliJ IDEA locates the prettier package itself and the field is filled in automatically. To set Prettier as the default formatting tool, select the Run on 'Reformat Code' action checkbox.
🌐
JetBrains
jetbrains.com › guide › tips › reformat-code-or-file
Reformat Your Code - JetBrains Guide
June 12, 2024 - You can quickly reformat the whole file by invoking "Reformat Code" ⌘⌥L (macOS) / Ctrl+Alt+L (Windows/Linux). As you'd expect, this works in any JetBrains IDE. However, what if you just want to reformat just one block of code?
🌐
JetBrains
jetbrains.com › guide › java › tutorials › reformatting-code › reformatting-a-selection-or-class
Reformatting a selection of code or class - JetBrains Guide
February 17, 2023 - You can use ⌘⌥L (macOS) / Ctrl+Alt+L (Windows/Linux) to reformat a selection of code according to your reformat settings. Let's press ⌘⌥L (macOS) / Ctrl+Alt+L (Windows/Linux) in the class that contains this horribly formatted code: public ...
🌐
JetBrains
jetbrains.com › help › idea › reformat-file-dialog.html
You will be redirected shortly
August 9, 2022 - You will be redirected shortly · Redirecting… · Click here if you are not redirected
🌐
YouTube
youtube.com › watch
Code Formatting in IntelliJ IDEA - YouTube
IntelliJ IDEA lets you reformat your code according to the requirements you've specified in the Code Style settings.In this screencast we're going to look at...
Published: May 20, 2020
🌐
Kingtigerebooks
kingtigerebooks.co.uk › post › how-to-beautify-code-in-php-storm-and-other-intellij-editors
How to beautify code in PhpStorm and other Intellij editors?
October 9, 2024 - After customizing the settings, apply the changes and save your configurations. You can now use your shortcuts to beautify your code according to your preferred style! Most IntelliJ IDEA-based editors (such as WebStorm, Android Studio, or PyCharm) share similar processes for beautifying code.