From e9825c7131a5162e95affba0b275a392ca2d2aff Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Mon, 22 Nov 2021 06:19:13 +0000 Subject: (Emacs)+olivetti Check the edit for a description of the package. Just setup a toggle based function to turn on olivetti-mode. --- Emacs/.config/emacs/config.org | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'Emacs/.config') diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index 787ca47..209c294 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -1065,6 +1065,33 @@ with colouring and a ton of presentations to choose from. (evil telephone-line-evil-tag-segment))) (telephone-line-mode)) #+end_src +** Olivetti +Olivetti provides a focus mode for Emacs, which makes it look a bit +nicer with fringes. I also define =+olivetti-mode= which will +remember and clear up any window configurations on the frame, then +when turned off will reinsert them - provides a nice way to quickly +focus on a buffer. +#+begin_src emacs-lisp +(use-package olivetti + :init + (setq-default olivetti-body-width 0.67) + (setq olivetti-style nil) + (add-hook 'olivetti-mode-on-hook (proc (interactive) (text-scale-increase 1))) + (add-hook 'olivetti-mode-off-hook (proc (interactive) (text-scale-decrease 1))) + :config + (defun +olivetti-mode () + (interactive) + (if (not olivetti-mode) + (progn + (window-configuration-to-register 1) + (delete-other-windows) + (olivetti-mode t)) + (jump-to-register 1) + (olivetti-mode 0))) + :general + (leader + "to" #'+olivetti-mode)) +#+end_src * Small packages ** ISearch #+begin_src emacs-lisp -- cgit v1.2.3-13-gbd6f