diff options
author | Bobby Bingham <koorogi@koorogi.info> | 2020-05-03 18:11:09 -0500 |
---|---|---|
committer | Bobby Bingham <koorogi@koorogi.info> | 2021-02-06 10:39:37 -0600 |
commit | bea7797d0eb286bf5e166139139919008e7df875 (patch) | |
tree | df0eceafdf7e7fcd1bbd238bd8834b99258ad603 | |
parent | af585ae18837120d457d4f75c046f33f16c73f8f (diff) |
emacs: limit visible whitespace to programming files
-rw-r--r-- | emacs/.emacs.d/init.el | 7 |
1 files changed, 6 insertions, 1 deletions
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)) |