emacs - Auto delete trailing whitespace and empty lines at begin or end of buffer
This commit is contained in:
parent
f567040a7a
commit
540b0ed4f5
1 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue