Search code examples
phpstorm

How to beautify code in PhpStorm and other Intellij editors?


Is there any way to beautify my php code in PhpStorm? (a keyboard shortcut would be preferable)


Solution

  • Select code to reformat and press Ctrl + Alt + Shift + L

    This is tested and working (Ubuntu), cheers!

    For Mac:

    Select code to reformat and press Command + Alt + Shift + L

    For full page code reformat Alt + Command + L

    Tested in phpStorm 2018.1.1