Shortcut Key to Format Apex Code in Salesforce Developer Console
Select all code using CTRL + A or just select a section of code to format, then press SHIFT + TAB in developer console.
Select all code using CTRL + A or just select a section of code to format, then press SHIFT + TAB in developer console.