Created
July 5, 2015 17:57
-
-
Save nyergler/939bdcc0fc54ddceab92 to your computer and use it in GitHub Desktop.
Whitespace like a civilized person
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; whitespace mode configuration | |
(require 'whitespace) | |
; make whitespace-mode use just basic coloring | |
(setq whitespace-style (quote | |
(spaces tabs newline tab-mark newline-mark face lines-tail))) | |
(setq show-trailing-whitespace 't) | |
(global-whitespace-mode 't) | |
;; make whitespace-mode use “¶” for newline and “▷” for tab. | |
;; together with the rest of its defaults | |
(setq whitespace-display-mappings | |
'( | |
(space-mark 32 [183] [46]) ; normal space, · | |
(space-mark 160 [164] [95]) | |
(space-mark 2208 [2212] [95]) | |
(space-mark 2336 [2340] [95]) | |
(space-mark 3616 [3620] [95]) | |
(space-mark 3872 [3876] [95]) | |
(newline-mark 10 [182 10]) ; newlne, ¶ | |
(tab-mark 9 [9655 9] [92 9]) ; tab, ▷ | |
)) | |
;; Trailing whitespace is unnecessary | |
(add-hook 'before-save-hook (lambda () (delete-trailing-whitespace))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment