From 78a64833e0c152c31f1b8eda2c2d42e5319a6e24 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Tue, 12 Sep 2023 17:33:14 +0100 Subject: Add Olivetti mode --- init.el | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/init.el b/init.el index d8c8334..14da65f 100644 --- a/init.el +++ b/init.el @@ -212,6 +212,31 @@ Restart works only on graphic display." ;; (when (member "Hack" (font-family-list)) ;; (add-to-list 'default-frame-alist '(font . "Hack-10"))))) +;; distraction free writing +;; from https://lucidmanager.org/productivity/ricing-org-mode/ + + +;; Distraction-free screen +(use-package olivetti + :init + (setq olivetti-body-width 0.5) + :config + (defun distraction-free () + "Distraction-free writing environment" + (interactive) + (if (equal olivetti-mode nil) + (progn + (window-configuration-to-register 1) + (delete-other-windows) + (text-scale-increase 2) + (olivetti-mode t)) + (progn + (jump-to-register 1) + (olivetti-mode 0) + (text-scale-decrease 2)))) + :bind + (("" . distraction-free))) + ;; theme (use-package gruber-darker-theme :ensure t -- cgit v1.2.3