2

I am currently using php-mode with spacemacs to write in php and recently I noticed this auto-indent behavior, namely pressing TAB.

switch ($cond) {
    case "something":
    break;
}

Auto indenting this region becomes

switch ($cond) {
case "something":
break;
}

I know that in js2-mode for javascript a variable called js-switch-indent-offset do the trick, but couldn't find the one related to php so far.

Rigotti
  • 153
  • 6

1 Answers1

1

You can customize the indent level of the switch case for PHP like this:

(c-set-offset 'case-label 4)

This should work for any language that's based on the c-mode.

Jesse
  • 1,984
  • 11
  • 19