I need to indent my code with (add-hook 'php-mode-hook 'php-enable-symfony2-coding-style)
but using tabs for indenting (and spaces for aligning, see https://www.emacswiki.org/emacs/SmartTabs). Apparently the coding styles of php-mode overrides emacs tab settings, because I have the next code in my emacs init file, but the spacebar indenting prevails nonetheless:
(setq tab-always-indent 'complete)
(setq-default indent-tabs-mode t)
(setq indent-tabs-mode t)
(setq tab-width 4)
Tabs were working before using php-mode.
Example of the indentation I use:
// Indenting with tabs
if (false
|| true
|| true
) {
$hi = [
'la',
'do' => 5,
];
$foo
-> mi(
54,
57
)
-> fa()
;
} else {
$lala =
(new lala)
-> hey()
-> ho()
;
$sup = work([
'it' => 1,
'faster' => 6,
]);
// Aligning with spaces
$a··· = 1;
$ab·· = 2;
$abcd = 4;
}
I am using (add-hook 'php-mode-hook 'php-enable-symfony2-coding-style)
because it is the most similar amongst the php-mode available styles. Maybe I should turn off php-mode indentation and use other indentation?