Switch to origami instead of hideshow

This commit is contained in:
Jeremy Dormitzer 2024-05-03 21:39:39 -04:00
parent b80b256786
commit 3f7dc1c744
2 changed files with 12 additions and 6 deletions

View File

@ -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)

View File

@ -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)