Emacs / Aquamacs php-mode和tabs缩进

时间:2011-11-17 01:43:33

标签: php emacs indentation aquamacs

我不能让我的Aquamacs 2.4(Emacs)遵循Kohana风格:

php-mode中的Emacs用空格替换制表符。我想禁用它并使用tab-characters作为缩进。

我尝试了很多这样的解决方案,但没有一个适合我:

(require 'php-mode)
(setq php-mode-force-pear t)
(add-hook 'php-mode-hook
      '(lambda ()
         (setq indent-tabs-mode t)
         (setq tab-width 4)
         (setq c-basic-offset 4)))

任何帮助表示感谢。

谢谢,   大卫

2 个答案:

答案 0 :(得分:0)

那应该做的工作:

(setq c-default-style "bsd"
      c-basic-offset 4)

cf How to configure Emacs (v 23) with nxhtml to follow Kohana coding standards?

答案 1 :(得分:0)

如果您正在寻找缩进标签和对齐空格,那么您可以使用SmartTabs (--->是一个标签,.是一个空格)

function example()
{
--->command();

--->if ($condition)
--->{
--->--->$arr = array('One',
--->--->.............'Two'); // Tabs for indent, spaces for alignment.
--->--->other_command();
--->}
}

emacswikigithub了解安装详情。

相关问题