0

For programming PHP with TextMate (OS X) I'd like it to use Allman indentation:

for($i = 0; $i < 1000; $i++)
{
    echo($i);
}

Rather than the default indentation:

for($i = 0; $i < 1000; $i++) {
    echo($i);
}

I can only find bundles to re-indent existing code, but not to simply use this indentation by default.

Rein
  • 1,347
  • 3
  • 17
  • 26

1 Answers1

0

Turned out to be simple. Simply press enter first, then type the first curly brace, like so:

  1. Type for($i = 0; $i < 1000; $i++)
  2. Press enter
  3. Type the opening curly brace {

Code will then be formatted like so:

for($i = 0; $i < 1000; $i++)
{
    echo($i);
}
Rein
  • 1,347
  • 3
  • 17
  • 26