Skip to content

Instantly share code, notes, and snippets.

@wardbekker
Created March 13, 2012 07:47
Show Gist options
  • Save wardbekker/2027489 to your computer and use it in GitHub Desktop.
Save wardbekker/2027489 to your computer and use it in GitHub Desktop.
highlight lines with trailing spaces, lines longer than 80 chars and tabs
;; 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