[emacs] set up outline-minor-mode for prog-mode, with bindings
authorAmin Bandali <mab@gnu.org>
Wed, 10 Oct 2018 02:39:22 +0000 (22:39 -0400)
committerAmin Bandali <mab@gnu.org>
Wed, 10 Oct 2018 02:39:22 +0000 (22:39 -0400)
init.org

index 68877ef..11ae4f0 100644 (file)
--- a/init.org
+++ b/init.org
@@ -921,6 +921,27 @@ There's no way I could top that, so I won't attempt to.
   :hook (ibuffer . (lambda () (ibuffer-switch-to-saved-filter-groups "default"))))
 #+end_src
 
+*** Outline
+
+#+begin_src emacs-lisp
+(use-package outline
+  :hook (prog-mode . outline-minor-mode)
+  :bind
+  (:map
+   outline-minor-mode-map
+   ("<s-tab>"  . outline-toggle-children)
+   ("s-p"      . outline-previous-visible-heading)
+   ("s-n"      . outline-next-visible-heading)
+   :prefix-map amin--outline-prefix-map
+   :prefix "s-o"
+   ("TAB" . outline-toggle-children)
+   ("a"   . outline-hide-body)
+   ("H"   . outline-hide-body)
+   ("S"   . outline-show-all)
+   ("h"   . outline-hide-subtree)
+   ("s"   . outline-show-subtree)))
+#+end_src
+
 * Borg's =layer/essentials=
 
 TODO: break this giant source block down into individual org sections.