]> git.donarmstrong.com Git - lib.git/commitdiff
add hydra
authorDon Armstrong <don@donarmstrong.com>
Wed, 3 Jun 2015 19:21:27 +0000 (12:21 -0700)
committerDon Armstrong <don@donarmstrong.com>
Wed, 3 Jun 2015 19:21:27 +0000 (12:21 -0700)
emacs_el/configuration/don-hydra.el [new file with mode: 0644]

diff --git a/emacs_el/configuration/don-hydra.el b/emacs_el/configuration/don-hydra.el
new file mode 100644 (file)
index 0000000..6c83042
--- /dev/null
@@ -0,0 +1,61 @@
+
+(require 'hydra)
+
+;; org mode files
+(defhydra my/hydra-orgmodes (:color blue :hint nil)
+  "
+_n_: notes _c_: chaim _w_: wildman _o_: ool
+_u_: uddin _s_: steve _r_: refile  _f_: fh    
+_q_: quit
+_z_: quit
+"
+  ("n" (find-file "~/projects/org-notes/notes.org"))
+  ("c" (find-file "~/projects/org-notes/chaim.org"))
+  ("w" (find-file "~/projects/org-notes/wildman.org"))
+  ("u" (find-file "~/projects/org-notes/uddin.org"))
+  ("o" (find-file "~/projects/org-notes/ool.org"))
+  ("f" (find-file "~/projects/org-notes/fh.org"))
+  ("s" (find-file "~/projects/org-notes/sndservers.org"))
+  ("r" (find-file "~/projects/org-notes/refile.org"))
+  ("q" nil "quit")
+  ("z" nil "quit")
+  )
+(global-set-key (kbd "C-c 2") 'my/hydra-orgmodes/body)
+(global-set-key (kbd "C-c @") 'my/hydra-orgmodes/body)
+
+
+;; from https://github.com/abo-abo/hydra/wiki/Emacs
+(defhydra my/hydra-outline (:color pink :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
+
+"
+  ;; Hide
+  ("q" hide-sublevels)    ; Hide everything but the top-level headings
+  ("t" hide-body)         ; Hide everything but headings (all body lines)
+  ("o" hide-other)        ; Hide other branches
+  ("c" hide-entry)        ; Hide this entry's body
+  ("l" hide-leaves)       ; Hide body lines in this entry and sub-entries
+  ("d" hide-subtree)      ; Hide everything in this entry and sub-entries
+  ;; Show
+  ("a" show-all)          ; Show (expand) everything
+  ("e" show-entry)        ; Show this heading's body
+  ("i" show-children)     ; Show this heading's immediate child sub-headings
+  ("k" show-branches)     ; Show all sub-headings under this heading
+  ("s" show-subtree)      ; Show (expand) everything in this heading & below
+  ;; Move
+  ("u" outline-up-heading)                ; Up
+  ("n" outline-next-visible-heading)      ; Next
+  ("p" outline-previous-visible-heading)  ; Previous
+  ("f" outline-forward-same-level)        ; Forward - same level
+  ("b" outline-backward-same-level)       ; Backward - same level
+  ("z" nil "leave"))
+
+(global-set-key (kbd "C-c #") 'my/hydra-outline/body) ; by example