Created
March 13, 2012 07:47
-
-
Save wardbekker/2027489 to your computer and use it in GitHub Desktop.
highlight lines with trailing spaces, lines longer than 80 chars and tabs
This file contains hidden or 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
;; taken from http://www.emacswiki.org/emacs/EightyColumnRule by http://www.emacswiki.org/emacs/TimOCallaghan | |
(custom-set-faces | |
'(my-tab-face ((((class color)) (:background "grey10"))) t) | |
'(my-trailing-space-face ((((class color)) (:background "gray10"))) t) | |
'(my-long-line-face ((((class color)) (:background "gray10"))) t)) | |
(add-hook 'font-lock-mode-hook | |
(function | |
(lambda () | |
(setq font-lock-keywords | |
(append font-lock-keywords | |
'(("\t+" (0 'my-tab-face t)) | |
("^.\\{81,\\}$" (0 'my-long-line-face t)) | |
("[ \t]+$" (0 'my-trailing-space-face t)))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment