In Eclipse, I can select a few lines and press Ctrl + I to reindent those lines. How do I do the same in IntelliJ IDEA / WebStorm?
Note:
In the Project tool window, right-click a module or a directory and from the context menu, select Reformat Code or press Ctrl+Alt+L . In the dialog that opens, specify the reformatting options and click OK.
Open indentation settings in code style scheme Click the widget and select Configure Indents for 'Language'. In the dialog that opens, you can change settings for tabs and indents and also configure other code style settings. Click OK. Reformat the necessary part of your project to apply new indentation settings.
In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | Code Style. Select a language for which you want to create arrangement rules. On the Arrangement tab, specify the appropriate options such as grouping and matching rules. Click OK to save the changes.
Code
| Auto-Indent Lines (Ctrl+Alt+I in Windows default keymap).
On a mac, it's Ctrl
+Option
+I
by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With