Created
April 1, 2010 14:52
-
-
Save ocharles/351889 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'cperl-mode) | |
(require 'magit) | |
(require 'uniquify) | |
(define-key global-map (kbd "C-C a") 'align-regexp) | |
;; Nice little hack I found in jrockway's .emacs | |
(defun delete-trailing-whitespace-nothere () | |
"Delete trailing whitespace, except on the current line if it is all whitespace." | |
(interactive) | |
(let (current-whitespace) | |
(when (save-excursion | |
(beginning-of-line) | |
(looking-at "\\([[:space:]]+\\)$")) | |
(setq current-whitespace (match-string 0))) | |
(delete-trailing-whitespace) | |
(save-excursion | |
(beginning-of-line) | |
(when current-whitespace | |
(insert current-whitespace))) | |
(when current-whitespace | |
(end-of-line)))) | |
(add-hook 'before-save-hook 'delete-trailing-whitespace-nothere) | |
(defalias 'perl-mode 'cperl-mode) | |
(add-to-list 'auto-mode-alist '("\\.t$" . cperl-mode)) | |
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(backward-delete-char-untabify-method (quote hungry)) | |
'(cperl-auto-newline t) | |
'(cperl-brace-offset -4) | |
'(cperl-close-paren-offset -4) | |
'(cperl-continued-statement-offset 4) | |
'(cperl-indent-level 4) | |
'(cperl-indent-parens-as-block t) | |
'(cperl-under-as-char t) | |
'(indent-tabs-mode nil)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment