aboutsummaryrefslogtreecommitdiff
path: root/Emacs/.config
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-05-06 02:35:57 +0530
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-05-06 02:38:06 +0530
commit60c9b63fedf56ac6cae34c831fb06e01ebee5440 (patch)
treea39d7b04c99acf496a42b75e14bbe331adde0608 /Emacs/.config
parent915971d5aa5a812de1ef137088c33eb92c2cc5ca (diff)
downloaddotfiles-60c9b63fedf56ac6cae34c831fb06e01ebee5440.tar.gz
dotfiles-60c9b63fedf56ac6cae34c831fb06e01ebee5440.tar.bz2
dotfiles-60c9b63fedf56ac6cae34c831fb06e01ebee5440.zip
(Emacs/config)+A simple presentation mode using org-mode and olivetti
Works by narrowing around subtrees and using olivetti for focus.
Diffstat (limited to 'Emacs/.config')
-rw-r--r--Emacs/.config/emacs/config.org47
1 files changed, 47 insertions, 0 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org
index 12644ab..80127fa 100644
--- a/Emacs/.config/emacs/config.org
+++ b/Emacs/.config/emacs/config.org
@@ -765,6 +765,53 @@ focus on a buffer.
(jump-to-register 1)
(olivetti-mode 0))))
#+end_src
+*** Presentation mode
+A simple presentation system using org-mode and olivetti.
+#+begin_src emacs-lisp
+(use-package olivetti
+ :defer t
+ :config
+ (defun +presentation/prev-slide ()
+ (interactive)
+ (when presentation-mode
+ (widen)
+ (outline-previous-visible-heading 1)
+ (end-of-line)
+ (if (org-fold-folded-p)
+ (org-cycle))
+ (org-narrow-to-subtree)))
+ (defun +presentation/next-slide ()
+ (interactive)
+ (when presentation-mode
+ (widen)
+ (outline-next-visible-heading 1)
+ (end-of-line)
+ (if (org-fold-folded-p)
+ (org-cycle))
+ (org-narrow-to-subtree)))
+ (defvar presentation-mode-map (make-sparse-keymap))
+ (define-minor-mode presentation-mode
+ "When in org-mode, use each heading like a slide!"
+ :lighter nil
+ :keymap presentation-mode-map
+ (cond
+ (presentation-mode
+ (olivetti-mode t)
+ (outline-show-heading)
+ (org-narrow-to-subtree))
+ (t
+ (olivetti-mode -1)
+ (widen))))
+ :general
+ (leader
+ :states 'normal
+ :keymaps 'presentation-mode-map
+ "j" #'+presentation/next-slide
+ "k" #'+presentation/prev-slide)
+ (local-leader
+ :keymaps 'org-mode-map
+ "P" #'presentation-mode))
+#+end_src
** All the Icons
Nice set of icons with a great user interface to manage them.
#+begin_src emacs-lisp