You can quickly format the selected code, the current file, or even an entire folder by pressing &shortcut:ReformatCode; (Code | Reformat Code). This action will also optimize import statements and delete unused ones.