如何在Emacs中调整cperl模式缩进以匹配Moose示例? [英] How do I adjust cperl mode indentation in Emacs to match Moose examples?

查看:125
本文介绍了如何在Emacs中调整cperl模式缩进以匹配Moose示例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How can I set up cperl mode in Emacs so that the indentation after brackets, e.g.

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

(默认缩进)变得更像在麋手册,例如

(default indentation) becomes more like that seen in, for example, the Moose manual, e.g.

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

推荐答案

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

I found the answer on the Emacs Wiki. Add the following to .emacs:

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

这篇关于如何在Emacs中调整cperl模式缩进以匹配Moose示例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆