4
votes

I'm a bit new to using emacs for webdevelopment. I am using php-mode and i am happy with it. There is only one issue i have which causes me a lot of problems because of our company's coding style.

When i have a function, e.g.:

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

And I want to indent it like this:

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

Emacs does the following when i insert a newline before the first argument and indents it like this:

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

Can anyone point me in a direction on how i can configure/change this?

Thanks in advance

2

2 Answers

3
votes

php-mode is actually build on top of cc-mode, so you can use cc-mode's indentation customization capabilities. Have a look here.

1
votes

In you .emacs file of configuration add this line:

(setq standard-indent X)

Being X the amount of spaces you want to indent while hitting TAB.