Make trailing whitespace less distracting and optional
By using font-lock-comment-face, it's less distracting than the default bright red, since comment face is designed to be subtle. Also allow users to turn it off by adding an option spacemacs-show-trailing-whitespace.
This commit is contained in:
parent
db47cead53
commit
760fa0dbe4
|
@ -121,7 +121,18 @@ It runs `tabulated-list-revert-hook', then calls `tabulated-list-print'."
|
||||||
;; because it avoids autoloads of elisp modes)
|
;; because it avoids autoloads of elisp modes)
|
||||||
(setq initial-major-mode 'text-mode)
|
(setq initial-major-mode 'text-mode)
|
||||||
;; whitespace-mode
|
;; whitespace-mode
|
||||||
(add-hook 'prog-mode-hook (lambda () (setq show-trailing-whitespace 1)))
|
(defcustom spacemacs-show-trailing-whitespace t
|
||||||
|
"If t, show trailing whitespace."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'spacemacs)
|
||||||
|
|
||||||
|
(add-hook 'prog-mode-hook (lambda ()
|
||||||
|
(when spacemacs-show-trailing-whitespace
|
||||||
|
(set-face-attribute 'trailing-whitespace nil
|
||||||
|
:background (face-attribute 'font-lock-comment-face
|
||||||
|
:foreground))
|
||||||
|
(setq show-trailing-whitespace 1))))
|
||||||
|
|
||||||
|
|
||||||
;; use only spaces and no tabs
|
;; use only spaces and no tabs
|
||||||
(setq-default indent-tabs-mode nil
|
(setq-default indent-tabs-mode nil
|
||||||
|
|
Loading…
Reference in a new issue