Skip to content

Instantly share code, notes, and snippets.

@Dyrcona
Last active January 1, 2017 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dyrcona/4216639 to your computer and use it in GitHub Desktop.
Save Dyrcona/4216639 to your computer and use it in GitHub Desktop.
My emacs cperl-mode configuration that conforms to the Evergreen coding guidelines.
;; Use cperl-mode by default
(defalias 'perl-mode 'cperl-mode)
;; cperl-mode doesn't have an add-style command, so we create our
;; style in a defun.
(defun evergreen-perl-style ()
"Set cperl-mode for Evergreen coding guidelines."
(setq cperl-indent-level 4
cperl-brace-offset 0
cperl-continued-brace-offset 0
cperl-label-offset -4
cperl-continued-statement-offset 4
cperl-close-paren-offset -4
cperl-indent-parens-as-block t
cperl-tab-always-indent t
cperl-merge-trailing-else t
cperl-left-aligned-indent-comments t
indent-tabs-mode nil))
;; Some cperl variables that I like to turn on:
(setq cperl-electric-parens t
cperl-electric-parens-mark t
cperl-electric-keywords t
cperl-electric-newline t)
;; cperl-mode hook
(add-hook 'cperl-mode-hook
(lambda ()
(evergreen-perl-style)
(local-set-key (kbd "C-c C-d") 'hungry-delete-forward)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment