这是我自己的.emacs
(又名用户自定义)设置。正上方whitespace-style
是可以通过将它们添加到whitespace-style
. 与使用 相比global-whitespace-mode
,我更喜欢(whitespace-mode t)
与某些主要模式挂钩一起使用。 whitespace-cleanup
是一个不依赖于尾随空白突出显示的函数。
;; (global-whitespace-mode t)
(setq whitespace-display-mappings '(
(space-mark ?\ [?\u00B7] [?.])
(space-mark ?\xA0 [?\u00A4] [?_])
(newline-mark ?\n [?¶ ?\n])
(tab-mark ?\t [?\u00BB ?\t] [?\\ ?\t])
))
;; lines lines-tail newline trailing space-before-tab space-afte-tab empty
;; indentation-space indentation indentation-tab tabs spaces
(setq whitespace-style '(face space-mark tab-mark newline-mark) )
(setq whitespace-line-column 85)
(custom-set-faces
'(whitespace-space ((t (:bold t :foreground "gray75"))))
'(whitespace-empty ((t (:foreground "firebrick" :background "SlateGray1"))))
'(whitespace-hspace ((t (:foreground "lightgray" :background "LemonChiffon3"))))
'(whitespace-indentation ((t (:foreground "firebrick" :background "beige"))))
'(whitespace-line ((t (:foreground "black" :background "red"))))
'(whitespace-newline ((t (:foreground "orange" :background "blue"))))
'(whitespace-space-after-tab ((t (:foreground "black" :background "green"))))
'(whitespace-space-before-tab ((t (:foreground "black" :background "DarkOrange"))))
'(whitespace-tab ((t (:foreground "blue" :background "white"))))
'(whitespace-trailing ((t (:foreground "red" :background "yellow"))))
)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1671 次 |
最近记录: |