How do I change indent in php-mode to 2 spaces in Emacs?

1.3k Views Asked by At

I try to change indent from 4 spaces to 2 spaces (I need to write code with this style).

I try to evaluate this in the buffer with php code:

(setq tab-width 2)

or

(setq-default tab-width 2)

but it didn't work, when I type TAB I got 4 spaces.

1

There are 1 best solutions below

3
On BEST ANSWER

Ok found it:

(setq c-basic-offset 2)