Manolo Manolo - 4 months ago 19x
PHP Question

Auto indentation in PhpStorm like in WebStorm by default

Using WebStorm with the default configuration, when I press

in a blank line with some spaces, the whole line is always deleted. Also, if I close a bracket for a function, the code inside is auto-indented.

I've tried to configure PhpStorm (7.1) with such functionalities (
Settings -> Code Style -> General
Settings -> Code Style -> PHP
). I thought that I had found it out when I saw
Tabs and Indents -> Smart Tabs
, but selecting those options nothing seems to change.

PhpStorm Tabs and Indents

How could I get the above behaviour in PhpStorm?


As @lena has suggested, I looked inside
Editor -> General -> Smart keys
, but doesn't exist any
Reformat block on typing '}'
option and the other stuff is enabled:

enter image description here


Please make sure you have Reformat block on typing '}' enabled in Settings | Editor | General | Smart keys. Also, please try playing with 'Backspace | Unindent' in Settings | Editor | General | Smart keys:

  • "Disabled' - smart backspace is turned off;
  • 'To nearest indent position' - deletes white spaces to nearest indent position, does not jump to the line above;
  • 'To proper indent position' - jumps to the line above.