summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
authornoa2024-09-17 10:32:07 +0800
committernoa2024-09-17 10:32:07 +0800
commit3048b47d0978ba5f1b8fd7ea76af7538b2a99b24 (patch)
treea14ee842ea2b52e6ae5feb3386c0deea70d9f30d /emacs
parent5ae6b650b451f6cd791fd0f8b5b5c1a1cbb68528 (diff)
Convert visual-fill-column to use-package
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el19
1 files changed, 6 insertions, 13 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 9b75f87..bf032ae 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -105,25 +105,18 @@
 ;; Ensure that transients look nice with a variable pitch font.
 (setopt transient-align-variable-pitch t)
 
-;;; Make wide windows narrow with visual-fill-column
 ;; Reading prose with long lines is a chore.  Luckily there are several packages in emacs to make the windows squeeze text into a more legible sliver.  Previously i used olivetti, which is a really nice package, but it's quite heavyweight and broke on me with no explanation more frequently than i appreciated.  I've switched to visual-fill-column and been quite satisfied.
-
-;; (package-ensure 'visual-fill-column)
 (use-package visual-fill-column
   :ensure t
   :custom
-  (visual-fill-column-enable-sensible-window-split t))
-
+  (visual-fill-column-enable-sensible-window-split t)
+  (visual-fill-column-fringes-outside-margins nil) ; Keep fringes on the inside so relevant icons are in the right place
+  :hook
+  ((text-mode . visual-line-fill-column-mode)
+   (eww-after-render . visual-line-fill-column-mode))
+  )
 ;; (advice-add 'text-scale-adjust :after #'visual-fill-column-adjust)
 
-(add-hook 'text-mode-hook #'visual-line-fill-column-mode)
-(add-hook 'eww-after-render-hook #'visual-line-fill-column-mode)
-(add-hook 'nov-post-html-render-hook #'visual-line-fill-column-mode)
-
-;; The fringes of a window can show useful icons relating to the text in the buffer.  For example, when using org modern, blocks get a line in the left fringe to show their content more clearly,  Because of this, i prefer for them to be right next to the buffer text.
-
-(setopt visual-fill-column-fringes-outside-margins nil)
-
 ;; Adaptive wrap will indent visually wrapped text to match the indent at the start of the line, for example in lists.  This works... fine.  However it's adapting the prefix, it doesn't indent nicely with proportional fonts, but you can't win them all.
 
 ;; (use-package adaptive-wrap :ensure t)