Nigel Banks
Nigel Banks

Reputation: 21

Emacs auto-formatting php code (on indent)

I'm looking for a way to format the spaces between symbols and keywords in emacs.

For example I'd like to change the following php code :

foreach($a as $b) {
}

into

foreach ($a as $b) {
}

All I've been able to find thus far are external tools to run from emacs.

Related : Auto formatting a PHP file in emacs.

I'd prefer that it did the formatting on indent, is this possible?

Upvotes: 1

Views: 255

Answers (1)

Stefan
Stefan

Reputation: 28531

Indeed, I don't know of any such tool within Emacs. I'd be happy to accept submission for a package that does something like that on the fly. Maybe it could work a bit like electric-layout-mode?

Upvotes: 1

Related Questions