summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-09-12 17:33:14 +0100
committerMatthew Lemon <y@yulqen.org>2023-09-12 17:33:14 +0100
commit78a64833e0c152c31f1b8eda2c2d42e5319a6e24 (patch)
tree6a96c31c180c881c446562ccc34b07fa5bd19a7a
parent723c8d540633fb1e14c147579a4ebf66deecbf1a (diff)
Add Olivetti mode
-rw-r--r--init.el25
1 files changed, 25 insertions, 0 deletions
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
+ (("<f9>" . distraction-free)))
+
;; theme
(use-package gruber-darker-theme
:ensure t