Skip to content

Instantly share code, notes, and snippets.

@robertzx
Created February 6, 2012 17:42
Show Gist options
  • Save robertzx/1753581 to your computer and use it in GitHub Desktop.
Save robertzx/1753581 to your computer and use it in GitHub Desktop.
;; zeevex whitespace standards WHETHER YOU LIKE IT OR NOT
;; TEST of 1753581
(require 'whitespace)
(defun activate-trailing-whitespace-nazi ()
"Annoy you with trailing whitespace, and then delete it on save anyway"
(interactive)
(whitespace-mode t)
(setq show-trailing-whitespace t)
(setq tab-width 2)
(setq indent-tabs-mode nil)
(add-hook 'local-write-file-hooks (lambda ()
(untabify (buffer-end 0) (buffer-end 1))
(delete-trailing-whitespace)
nil)))
(add-hook 'ruby-mode-hook 'activate-trailing-whitespace-nazi)
(add-hook 'yaml-mode-hook 'activate-trailing-whitespace-nazi)
(provide 'my-whitespace-nazi)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment