From c0db27066a2477fc7c5838f86c376add7e332f80 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sun, 28 Jun 2015 11:14:40 -0400 Subject: [PATCH] add some hydras --- .emacs.d/el-get-user/init-files/init-hydra.el | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .emacs.d/el-get-user/init-files/init-hydra.el diff --git a/.emacs.d/el-get-user/init-files/init-hydra.el b/.emacs.d/el-get-user/init-files/init-hydra.el new file mode 100644 index 0000000..a6c2ace --- /dev/null +++ b/.emacs.d/el-get-user/init-files/init-hydra.el @@ -0,0 +1,59 @@ +(require 'hydra-examples) +(defhydra hydra-window (:hint nil) + " + Split: _v_:vert _x_:horz + Delete: _c_lose _o_nly + Switch Window: _h_:left _j_:down _k_:up _l_:right + Ace: _a_ce _s_:swap + Buffers: _p_revious _n_ext _b_:select _f_ind-file + Resize: _H_:splitter left _J_:splitter down _K_:splitter up _L_:splitter right" + + ("h" windmove-left) + ("j" windmove-down) + ("k" windmove-up) + ("l" windmove-right) + + ("p" previous-buffer) + ("n" next-buffer) + ("b" ido-switch-buffer) + ("f" ido-find-file) + + ("x" split-window-below) + ("v" split-window-right) + + ("a" ace-window) + ("s" ace-swap-window) + + ("c" delete-window) + ("o" delete-other-windows) + + ("H" hydra-move-splitter-left) + ("J" hydra-move-splitter-down) + ("K" hydra-move-splitter-up) + ("L" hydra-move-splitter-right) + + ("q" nil)) + +(defhydra hydra-stuff (:hint nil :color blue) + " +_d_: insert date +_t_: open todo file" + + ("d" insert-date) + ("t" todotxt-open-file) + ("q" nil)) + +(defhydra hydra-avy (:hint nil :color blue) + " +char: _c_: 1 char _C_: 2 char +word: _w_: 1 char _W_: 0 char" + + ("c" avy-goto-char) + ("C" avy-goto-char-2) + ("w" avy-goto-word-1) + ("W" avy-goto-word-0) + ("q" nil)) + +(global-set-key (kbd "C-c w") 'hydra-window/body) +(global-set-key (kbd "C-c s") 'hydra-stuff/body) +(global-set-key (kbd "C-c a") 'hydra-avy/body)