Add lost trailing whitespace visualization

This commit is contained in:
2025-09-22 17:04:53 +02:00
parent ec91d7af38
commit 2b94fb15d4

View File

@@ -8,6 +8,25 @@
(global-auto-revert-mode t)
;; Electric-pair-mode is replaced by smartparens in init-qol.el
;;; Whitespace handling
;; Show trailing whitespace in programming modes
(add-hook 'prog-mode-hook
(lambda ()
(setq show-trailing-whitespace t)))
;; Also show trailing whitespace in text modes
(add-hook 'text-mode-hook
(lambda ()
(setq show-trailing-whitespace t)))
;; Delete trailing whitespace on save
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; Optionally, you can make trailing whitespace more visible
(setq-default show-trailing-whitespace t)
(custom-set-faces
'(trailing-whitespace ((t (:background "red1")))))
;;; Shift-Selection Configuration
;; Enable shift-select mode for selecting text with Shift+Arrow keys
(setq shift-select-mode t)