diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 9a5d5e8..a6ff560 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -141,6 +141,14 @@ (tool-bar-mode -1)) (menu-bar-mode -1) +;; Buffer cleanup +(defun buffer-cleanup-whitespace () + "Remove trailing whitespaces upon save" + (let ((whitespace-style '(empty trailing))) + (whitespace-cleanup))) +(add-hook 'before-save-hook 'buffer-cleanup-whitespace) +(setq-default show-trailing-whitespace t) + ;; ensure repo cache is up1date (or (file-exists-p package-user-dir) (package-refresh-contents)) @@ -172,8 +180,6 @@ ;; No tabs - tabs are evil (setq indent-tabs-mode nil) -;; No trailing whitespaces - those are even evileler -(setq show-trailing-whitespace t) (use-package delight :ensure t