Emacs & PHP indentation

I am a little new to using emacs for webdevelopment. I am using php-mode and I am pleased with that. There is only one problem that causes me many problems due to the style of our company.

When I have a function, for example:

$instance = new Model('foo', 'bar'); 

And I want to postpone it like this:

 $instance = new Model( 'foo', 'bar' ); 

Emacs does the following when I insert a new line before the first argument and backtrack like this:

 $instance = new Model( 'foo', 'bar' ); 

Can someone tell me how I can configure / change this?

Thanks in advance

+4
source share
2 answers

php-mode is actually built on top of cc-mode, so you can use the cc-mode padding options. Take a look here .

+3
source

In the .emacs configuration file, add this line:

(setq standard-indent X)

Be X is the number of spaces you want to indent when you press TAB.

+1
source

Source: https://habr.com/ru/post/1313174/


All Articles