phpstormwebstormjetbrains-ide

how to align text to specific character in phpstorm or webstorm?


I have this text

$test1 = 'testing1';
$test1test1 = 'testing1';
$test1test1test1 = 'testing1';
$test1 = 'testing1';

and I would like to align it like this, using tabs,

$test1           = 'testing1';
$test1test1      = 'testing1';
$test1test1test1 = 'testing1';
$test1           = 'testing1';

is there a way of doing this in phpstorm or webstorm ?


Solution

  • ++L (on macOS) or Ctrl+Alt+L (on Windows) in PhpStorm will format code depending on your configured coding style.

    To set this code style in Settings:

    Editor -> Code style -> PHP (or your chosen Language) -> Wrapping, Braces & Alignment -> Assignment expression -> Alignment: On consecutive lines.