summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-07-31 21:45:21 -0400
committerKyle Meyer <kyle@kyleam.com>2015-07-31 21:45:21 -0400
commit2473f10433301809c75acce936dab89c95f6764b (patch)
treeb107fb95cec3c754d4d756f4d6b489a0cd7682e0
parenta12f7f01ea8e1ee92d1123164b93611091dbf085 (diff)
downloademacs.d-2473f10433301809c75acce936dab89c95f6764b.tar.gz
Add outline mode hydra
-rw-r--r--init.el1
-rw-r--r--lisp/init-outline.el43
2 files changed, 44 insertions, 0 deletions
diff --git a/init.el b/init.el
index 6ec642f..45a160e 100644
--- a/init.el
+++ b/init.el
@@ -28,6 +28,7 @@
(require 'init-view)
(require 'init-editing)
+(require 'init-outline)
(require 'init-god)
(require 'init-text)
diff --git a/lisp/init-outline.el b/lisp/init-outline.el
new file mode 100644
index 0000000..433ab0f
--- /dev/null
+++ b/lisp/init-outline.el
@@ -0,0 +1,43 @@
+
+;; Modified from https://github.com/abo-abo/hydra/wiki/Emacs
+(defhydra hydra-outline-mode (:hint nil)
+ "
+ ^^Hide ^^Show ^^Move
+_q_ sublevels _a_ all _u_ up
+_t_ body _e_ entry _n_ next visible
+_o_ other _i_ children _p_ previous visible
+_c_ entry _k_ branches _f_ forward same level
+_l_ leaves _s_ subtree _b_ backward same level
+_d_ subtree
+
+"
+ ("q" hide-sublevels)
+ ("t" hide-body)
+ ("o" hide-other)
+ ("c" hide-entry)
+ ("l" hide-leaves)
+ ("d" hide-subtree)
+
+ ("a" show-all)
+ ("e" show-entry)
+ ("i" show-children)
+ ("k" show-branches)
+ ("s" show-subtree)
+
+ ("u" outline-up-heading)
+ ("n" outline-next-visible-heading)
+ ("p" outline-previous-visible-heading)
+ ("f" outline-forward-same-level)
+ ("b" outline-backward-same-level)
+
+ ("m" outline-mark-subtree "mark" :color blue))
+
+(defun km/hydra-outline-mode ()
+ (interactive)
+ (unless outline-minor-mode
+ (outline-minor-mode))
+ (hydra-outline-mode/body))
+
+(global-set-key (kbd "C-c n") 'km/hydra-outline-mode)
+
+(provide 'init-outline)