Setting Up "Format on Save" in IntelliJ IDEA
1. Open Settings:
On macOS: Cmd + ,
On Windows/Linux: Ctrl + Alt + S
2. Navigate to "Actions on Save":
In the settings panel, navigate to File | Settings | Tools | Actions on Save (or Preferences | Tools | Actions on Save on macOS).
3. Enable Reformat Code:
In the "Actions on Save" section, check the "Reformat code" option. This will ensure that the code is automatically reformatted when you save the file.
4. Save Settings:
Click "OK" or "Apply" to save the settings.
8 сен 2024