summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-05-21 01:48:11 -0400
committerKyle Meyer <kyle@kyleam.com>2015-05-21 01:48:11 -0400
commit8172974e82a1c35cfdd1dfd29265ca3f41b57dd2 (patch)
tree0125d0bf3dc78f8d8b5807d9a7423e40cbfdcfac /lisp
parente53becab23aeae58b4d156f9d45428342c15a4b1 (diff)
downloademacs.d-8172974e82a1c35cfdd1dfd29265ca3f41b57dd2.tar.gz
Make hydra map for Paredit bindings
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-elisp.el44
1 files changed, 40 insertions, 4 deletions
diff --git a/lisp/init-elisp.el b/lisp/init-elisp.el
index 8ec711d..a1cc592 100644
--- a/lisp/init-elisp.el
+++ b/lisp/init-elisp.el
@@ -6,10 +6,46 @@
(add-hook 'emacs-lisp-mode-hook 'enable-paredit-mode)
(after 'paredit
- (define-key paredit-mode-map (kbd "C-,") 'paredit-forward-slurp-sexp)
- (define-key paredit-mode-map (kbd "C-.") 'paredit-forward-barf-sexp)
- (define-key paredit-mode-map (kbd "C-M-,") 'paredit-backward-slurp-sexp)
- (define-key paredit-mode-map (kbd "C-M-.") 'paredit-backward-barf-sexp)
+ (define-key paredit-mode-map (kbd "C-,")
+ (defhydra hydra-paredit ()
+ "
+_a_: beginning of defun _j_: forward slurp
+_f_: forward _k_: forward barf
+_b_: backward _u_: backward slurp
+_p_: backward down _i_: backward barf
+_n_: forward up
+_d_: forward down _w_: copy as kill
+_v_: backward up _q_: indent sexp
+
+_c_: convolute sexp _l_: split sexp
+_r_: raise _o_: join sexp
+_s_: splice sexp
+_R_: wrap round
+"
+ ("j" paredit-forward-slurp-sexp nil)
+ ("k" paredit-forward-barf-sexp nil)
+ ("u" paredit-backward-slurp-sexp nil)
+ ("i" paredit-backward-barf-sexp nil)
+
+ ("a" beginning-of-defun nil)
+ ("f" paredit-forward nil)
+ ("b" paredit-backward nil)
+ ("p" paredit-backward-down nil)
+ ("n" paredit-forward-up nil)
+ ("d" paredit-forward-down nil)
+ ("v" paredit-backward-up nil)
+
+ ("c" paredit-convolute-sexp nil)
+ ("r" paredit-raise-sexp nil)
+ ("s" paredit-splice-sexp nil)
+ ("R" paredit-wrap-round nil)
+
+ ("l" paredit-split-sexp nil)
+ ("o" paredit-join-sexps nil)
+
+ ("w" paredit-copy-as-kill nil)
+
+ ("q" indent-pp-sexp nil)))
;; Don't let `paredit-splice-sexp' override default 'M-s' map.
(define-key paredit-mode-map (kbd "M-s") nil)