From 3f7dc1c744fec92f05279d952892ee2409ea2891 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Fri, 3 May 2024 21:39:39 -0400 Subject: [PATCH] Switch to origami instead of hideshow --- emacs/.emacs.d/config/init-built-ins.el | 6 ------ emacs/.emacs.d/config/init-editing.el | 12 ++++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/emacs/.emacs.d/config/init-built-ins.el b/emacs/.emacs.d/config/init-built-ins.el index 6eba99d..3e740f6 100644 --- a/emacs/.emacs.d/config/init-built-ins.el +++ b/emacs/.emacs.d/config/init-built-ins.el @@ -53,12 +53,6 @@ :defer t :straight (:type built-in)) -(use-package hideshow - :straight (:type built-in) - :hook (prog-mode . hs-minor-mode) - :init - (general-def 'normal "zM" #'hs-hide-level)) - (use-package man :straight (:type built-in) :commands (man) diff --git a/emacs/.emacs.d/config/init-editing.el b/emacs/.emacs.d/config/init-editing.el index 88bbfb6..128bd46 100644 --- a/emacs/.emacs.d/config/init-editing.el +++ b/emacs/.emacs.d/config/init-editing.el @@ -139,4 +139,16 @@ :general (normal "gc" #'evil-operator-string-inflection)) +(use-package origami + :hook ((prog-mode . origami-mode) + (text-mode . origami-mode)) + :config + (defun origami-toggle-all-nodes-same-level (buffer point) + (interactive (list (current-buffer) (point))) + (when-let ((tree (origami-get-fold-tree buffer))) + (when-let ((path (origami-fold-find-path-containing tree point))) + (let ((parent (origami-fold-parent path))) + (dolist (fold (origami-fold-children parent)) + (origami-toggle-node buffer (origami-fold-beg fold)))))))) + (provide 'init-editing)