help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to change Perl mode indentation to two spaces and no tabs?


From: John Mastro
Subject: Re: How to change Perl mode indentation to two spaces and no tabs?
Date: Mon, 15 Jun 2015 12:47:05 -0700

>   I like the syntax highlighting and the formatting (in general) of
> the perl mode, I just want multiples of two spaces for indentation
> rather than multiples of  four.

Then it looks like you'll want something like:

    (defun my-init-perl-mode ()
      (setq perl-indent-level 2
            perl-continued-statement-offset 2
            perl-continued-brace-offset -2))

    (eval-after-load 'perl-mode
      '(add-hook 'perl-mode-hook #'my-init-perl-mode))

See `C-h f perl-mode RET' for more information on those, and other,
options. I based the above on the "LW" style (the default) with every 4
replaced by a 2.

-- 
john



reply via email to

[Prev in Thread] Current Thread [Next in Thread]