简体   繁体   中英

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

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

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

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

?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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