I tend to user four space per indentation level, which braces on a line be themselves, splitting the identation ie
Code: Select all
<?php
echo "Normal, no identation at top level";
if ($foo)
{ // indented two characters
echo "Indented two chracters";
}
echo "Back to normal";
?>
This is the current default configuration for PHP-mode, I found, for Emacs.
I used to use four spaces per level, braces on lines by themselves, lined up with their starting block
Code: Select all
<?php
echo "Normal, no identation at top level";
if ($foo)
{
echo "Indented four chracters";
}
echo "Back to normal";
?>
This was the default configuration for Perl-mode in Emacs which I used before I found PHP-mode. I actually like this style a little better, but PHP-mode does a much better job context coloring and I'm too lazy to hack the mode file.
I'm not 100% sure, but I believe these modes automatically convert the tabs to spaces.