mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
refactor: Visual indentation guides
- Switch from highlight-indentation package to highlight-indent-guides. - Activate visual indentation in a prog-mode hook, rather than doing within each individual major mode. It was already done within all major modes based on prog-mode anyway. - Add new siren-display-indetation module and function as a central way to enable visual indetation guides. This makes switching the underlying package at some point in the future much easier.
This commit is contained in:
17
modules/editor/siren-display-indentation.el
Normal file
17
modules/editor/siren-display-indentation.el
Normal file
@@ -0,0 +1,17 @@
|
||||
;;; siren-display-indentation.el --- jimeh's Emacs Siren: indent guides setup
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Setup for rendering indent guides.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'siren-highlight-indent-guides)
|
||||
|
||||
(defun siren-display-indentation (&optional arg)
|
||||
"Activate or deactivate indentation guides.
|
||||
Optional ARG is passed directly to mode toggle function."
|
||||
(highlight-indent-guides-mode (or arg t)))
|
||||
|
||||
(provide 'siren-display-indentation)
|
||||
;;; siren-display-indentation.el ends here
|
||||
@@ -9,7 +9,19 @@
|
||||
(use-package highlight-indent-guides
|
||||
:defer t
|
||||
:commands highlight-indent-guides-mode
|
||||
:diminish highlight-indent-guides-mode)
|
||||
:diminish highlight-indent-guides-mode
|
||||
|
||||
:hook
|
||||
(prog-mode . highlight-indent-guides-mode)
|
||||
|
||||
:custom
|
||||
(highlight-indent-guides-auto-even-face-perc 3)
|
||||
(highlight-indent-guides-auto-odd-face-perc 2.5)
|
||||
(highlight-indent-guides-auto-top-even-face-perc 12)
|
||||
(highlight-indent-guides-auto-top-odd-face-perc 10)
|
||||
(highlight-indent-guides-character ?\u2502)
|
||||
(highlight-indent-guides-method 'column)
|
||||
(highlight-indent-guides-responsive 'top))
|
||||
|
||||
(provide 'siren-highlight-indent-guides)
|
||||
;;; siren-highlight-indent-guides.el ends here
|
||||
|
||||
@@ -9,7 +9,10 @@
|
||||
(use-package highlight-indentation
|
||||
:defer t
|
||||
:diminish (highlight-indentation-mode
|
||||
highlight-indentation-current-column-mode))
|
||||
highlight-indentation-current-column-mode)
|
||||
|
||||
:hook
|
||||
(prog-mode . highlight-indent-guides-mode))
|
||||
|
||||
(provide 'siren-highlight-indentation)
|
||||
;;; siren-highlight-indentation.el ends here
|
||||
|
||||
Reference in New Issue
Block a user