From bea7797d0eb286bf5e166139139919008e7df875 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Sun, 3 May 2020 18:11:09 -0500 Subject: emacs: limit visible whitespace to programming files --- emacs/.emacs.d/init.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'emacs/.emacs.d/init.el') diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 2105459..baca500 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -35,7 +35,6 @@ ;; --- GLOBAL MODES --- (evil-mode 1) ;; Make emacs usable (global-hl-line-mode 1) ;; Highlight the line containing the cursor -(global-whitespace-mode 1) ;; Display whitespace, highlight trailing whitespace (show-paren-mode 1) ;; Highlight matching parenthesis (use-package ivy @@ -138,6 +137,12 @@ (require 'telephone-line) (telephone-line-mode 1) +;; --- WHITESPACE --- +;; Show whitespace for prog-mode, but not other modes +(define-global-minor-mode bab/global-whitespace-mode whitespace-mode + (lambda () (when (derived-mode-p 'prog-mode) (whitespace-mode)))) +(bab/global-whitespace-mode 1) + ;; --- INDENTATION --- ;; Two callable functions for enabling/disabling tabs in Emacs (defun disable-tabs () (setq indent-tabs-mode nil)) -- cgit v1.2.3