Skip to content

Commit

Permalink
feat(emacs): add global whitespace-mode toggle for prog-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
gekoke committed Dec 4, 2024
1 parent 03ed9c3 commit 787eb59
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions modules/nixos/programs/emacs/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,12 @@

(use-package whitespace
:ensure nil
:hook
(prog-mode . whitespace-mode)
:init
(define-global-minor-mode gg/global-whitespace-mode whitespace-mode
(lambda ()
(when (derived-mode-p 'prog-mode)
(whitespace-mode))))
(gg/global-whitespace-mode)
:custom
(whitespace-display-mappings
'((space-mark 32
Expand All @@ -198,7 +202,10 @@
[187 9]
[92 9])))
(whitespace-style
'(face tabs spaces trailing space-before-tab indentation empty space-after-tab space-mark tab-mark)))
'(face tabs spaces trailing space-before-tab indentation empty space-after-tab space-mark tab-mark))
:general
(gg/leader
"e w" #'gg/global-whitespace-mode))

;; TODO: serialize to file
(defun gg/set-background-opacity (opacity)
Expand Down

0 comments on commit 787eb59

Please sign in to comment.