How to correct indentation in IntelliJ
问题 How can indentation be automatically (not manually) corrected in IntelliJ? In Eclipse, it's possible to just highlight the code that needs indenting, right-click, and select Source > Correct indentation . Is there any method for doing the same thing in IntelliJ? 回答1: Code → Reformat Code... (default Ctrl + Alt + L ) for the whole file or Code → Auto-Indent Lines (default Ctrl + Alt + I ) for the current line or selection. You can customise the settings for how code is auto-formatted under