Add whitespace-cleanup-mode.

This commit is contained in:
tastytea 2021-05-15 03:35:19 +02:00
parent 6af77ec055
commit f418ff4cb1
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 10 additions and 2 deletions

View File

@ -283,8 +283,16 @@
:bind ("C-c w" . whitespace-mode)
:hook ((prog-mode . my/ws-load-local-vars-first)
(conf-mode . my/ws-load-local-vars-first)
(text-mode . my/ws-load-local-vars-first)
(before-save . my/ws-maybe-cleanup)))
(text-mode . my/ws-load-local-vars-first)))
;; Calls whitespace-cleanup before saving the current buffer, but only if the
;; whitespace in the buffer was initially clean.
(use-package whitespace-cleanup-mode
:after (whitespace)
:config (global-whitespace-cleanup-mode)
:hook (change-major-mode-hook
. (lambda () (when (not my/reformat-save)
(setq-local whitespace-cleanup-mode nil)))))
;; ripgrep.
(use-package rg