如何调整Emacs中的cperl模式缩进以匹配Moose示例?

时间:2010-07-01 06:17:19

标签: perl emacs indentation cperl-mode

如何在Emacs中设置cperl模式,以便括号后的缩进,例如

has 'name'    => (
                  is       => 'rw',
                  isa      => 'Str',
                  required => 1,
              );

(默认缩进)变得更像是在the Moose manual中看到的,例如

has 'password' => (
    is  => 'rw',
    isa => 'Str',
);

1 个答案:

答案 0 :(得分:7)

我在the Emacs Wiki找到了答案。将以下内容添加到.emacs:

(custom-set-variables
     '(cperl-indent-parens-as-block t))