mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
When whitespace-mode is enabled, single-line copilot completions makes the cursor look like it's at the end of the completion rather than in it's real position. Issue with gifs showing the behavior is here: https://github.com/zerolfx/copilot.el/issues/28 For the most part I should be able to live without whitespace-mode in day to day use, and improvements to the highlight-indent-guides setup should help. And worst case, whitespace-mode can always be toggled easily enough.
42 lines
1.5 KiB
EmacsLisp
42 lines
1.5 KiB
EmacsLisp
;;; siren-whitespace.el --- jimeh's Emacs Siren: whitespace configuration.
|
|
|
|
;;; Commentary:
|
|
|
|
;; Basic configuration for whitespace-mode.
|
|
|
|
;;; Code:
|
|
|
|
(use-package whitespace
|
|
:straight (:type built-in)
|
|
:diminish whitespace-mode global-whitespace-mode
|
|
:hook
|
|
(prog-mode . whitespace-cleanup-on-save-mode)
|
|
|
|
:preface
|
|
(define-minor-mode whitespace-cleanup-on-save-mode
|
|
"Run whitespace-cleanup on buffer save"
|
|
:global nil
|
|
(if whitespace-cleanup-on-save-mode
|
|
(add-hook 'before-save-hook 'whitespace-cleanup-on-save-cleanup)
|
|
(remove-hook 'before-save-hook 'whitespace-cleanup-on-save-cleanup)))
|
|
|
|
(defun whitespace-cleanup-on-save-cleanup()
|
|
(when (bound-and-true-p whitespace-cleanup-on-save-mode)
|
|
(whitespace-cleanup)))
|
|
|
|
:config
|
|
(setq whitespace-line-column 80
|
|
whitespace-style '(face tabs trailing space-before-tab newline
|
|
indentation space-after-tab tab-mark
|
|
newline-mark empty)
|
|
whitespace-display-mappings '((newline-mark ?\n
|
|
[?\u00AC ?\n] ;; \u00AC = ¬
|
|
[?$ ?\n])
|
|
(tab-mark ?\t
|
|
[?\u2192 ?\t] ;; \u2192 = →
|
|
[?\u00BB ?\t] ;; \u00BB = »
|
|
[?\\ ?\t]))))
|
|
|
|
(provide 'siren-whitespace)
|
|
;;; siren-whitespace.el ends here
|