简体   繁体   English

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

[英]How do I adjust cperl mode indentation in Emacs to match Moose examples?

How can I set up cperl mode in Emacs so that the indentation after brackets, eg 如何在Emacs中设置cperl模式,以便括号后的缩进,例如

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

(default indentation) becomes more like that seen in, for example, the Moose manual , eg (默认缩进)变得更像是在例如Moose手册中看到的,例如

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

?

I found the answer on the Emacs Wiki . 在Emacs Wiki上找到了答案。 Add the following to .emacs: 将以下内容添加到.emacs:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM