Add: feature/hydra: initial commit

This commit is contained in:
Benjamin Andresen 2017-06-26 20:32:28 +02:00
parent d6762bc893
commit 15cd2d5e0c
5 changed files with 106 additions and 0 deletions

View File

@ -34,6 +34,7 @@
jump ; helping you get around
snippets ; my elves. They type so I don't have to
file-templates ; auto-snippets for empty files
hydra ; keybindings that stick around
spellcheck ; tasing you for misspelling mispelling
syntax-checker ; tasing you for every semicolon you forget
version-control ; remember, remember that commit in November

View File

@ -0,0 +1,2 @@
;;; feature/hydra/autoload/evil.el -*- lexical-binding: t; -*-

View File

@ -0,0 +1,2 @@
;;; feature/hydra/autoload/hydras.el -*- lexical-binding: t; -*-

View File

@ -0,0 +1,94 @@
;;; feature/hydra/config.el -*- lexical-binding: t; -*-
(def-package! hydra
:commands (+hydra-zoom/body +hydra-window/body)
:config
(defhydra +hydra-zoom (:hint t :color red)
"zoom"
("j" text-scale-increase "in")
("k" text-scale-decrease "out")
("0" (text-scale-set 0) "reset"))
(defhydra +hydra-window (:hint nil)
"
Split: _v_ert _s_:horz
Delete: _c_lose _o_nly
Switch Window: _h_:left _j_:down _k_:up _l_:right
Buffers: _p_revious _n_ext _b_:select _f_ind-file
Resize: _H_:splitter left _J_:splitter down _K_:splitter up _L_:splitter right
Move: _a_:up _z_:down _i_menu"
("z" scroll-up-line)
("a" scroll-down-line)
("i" idomenu)
("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)
("s" split-window-below)
("v" split-window-right)
("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)))
(when (featurep! :completion ivy)
(def-package! ivy-hydra
:config
(define-key ivy-mode-map (kbd "C-o")
(defhydra coo-ivy (:hint nil :color pink)
"
Move ^^^^^^^^^^ | Call ^^^^ | Cancel^^ | Options^^ | Action _w_/_s_/_a_: %s(ivy-action-name)
----------^^^^^^^^^^-+--------------^^^^-+-------^^-+--------^^-+---------------------------------
_g_ ^ ^ _k_ ^ ^ _u_ | _f_orward _o_ccur | _i_nsert | _c_alling: %-7s(if ivy-calling \"on\" \"off\") _C_ase-fold: %-10`ivy-case-fold-search
^^ _h_ ^+^ _l_ ^^ | _RET_ done ^^ | _q_uit | _m_atcher: %-7s(ivy--matcher-desc) _t_runcate: %-11`truncate-lines
_G_ ^ ^ _j_ ^ ^ _d_ | _TAB_ alt-done ^^ | ^ ^ | _<_/_>_: shrink/grow
"
;; arrows
("j" ivy-next-line)
("k" ivy-previous-line)
("l" ivy-alt-done)
("h" ivy-backward-delete-char)
("g" ivy-beginning-of-buffer)
("G" ivy-end-of-buffer)
("d" ivy-scroll-up-command)
("u" ivy-scroll-down-command)
("e" ivy-scroll-down-command)
;; actions
("q" keyboard-escape-quit :exit t)
("C-g" keyboard-escape-quit :exit t)
("<escape>" keyboard-escape-quit :exit t)
("C-o" nil)
("i" nil)
("TAB" ivy-alt-done :exit nil)
("C-j" ivy-alt-done :exit nil)
;; ("d" ivy-done :exit t)
("RET" ivy-done :exit t)
("C-m" ivy-done :exit t)
("f" ivy-call)
("c" ivy-toggle-calling)
("m" ivy-toggle-fuzzy)
(">" ivy-minibuffer-grow)
("<" ivy-minibuffer-shrink)
("w" ivy-prev-action)
("s" ivy-next-action)
("a" ivy-read-action)
("t" (setq truncate-lines (not truncate-lines)))
("C" ivy-toggle-case-fold)
("o" ivy-occur :exit t)))))

View File

@ -0,0 +1,7 @@
;; -*- no-byte-compile: t; -*-
;;; feature/hydra/packages.el
(package! hydra)
(when (featurep! :completion ivy)
(package! ivy-hydra))