]> code.delx.au - gnu-emacs-elpa/blobdiff - ivy-hydra.el
Fix minibuffer collapses to one line
[gnu-emacs-elpa] / ivy-hydra.el
index 8cfb134142d190d294b08b01fa914241588506a0..6ab1f9aebe79a8cf0daa0e702d251fea01d3da15 100644 (file)
 ;; shorter than usual, using mostly unprefixed keys.
 
 ;;; Code:
-(require 'hydra)
+(require 'hydra nil t)
 (require 'ivy)
 
-(unless (package-installed-p 'hydra)
-  (defmacro defhydra (name &rest _)
-    "This is a stub for the uninstalled `hydra' package."
-    `(defun ,(intern (format "%S/body" name)) ()
-       (interactive)
-       (if (yes-or-no-p "Package `hydra' not installed. Install?")
-           (progn
-             (package-install 'hydra)
-             (save-window-excursion
-               (find-library "ivy-hydra")
-               (byte-compile-file (buffer-file-name) t)))
-         (error "Please install `hydra' and recompile/reinstall `ivy-hydra'")))))
-
-
+(eval-when-compile
+  (unless (or (featurep 'hydra) (package-installed-p 'hydra))
+    (defmacro defhydra (name &rest _)
+      "This is a stub for the uninstalled `hydra' package."
+      `(defun ,(intern (format "%S/body" name)) ()
+         (interactive)
+         (let ((enable-recursive-minibuffers t))
+           (if (yes-or-no-p "Package `hydra' not installed. Install?")
+               (progn
+                 (package-install 'hydra)
+                 (save-window-excursion
+                   (find-library "ivy-hydra")
+                   (byte-compile-file (buffer-file-name) t)))
+             (error "Please install `hydra' and recompile/reinstall `ivy-hydra'")))))))
 
 (defhydra hydra-ivy (:hint nil
                      :color pink)
   "
-^^^^^^          ^Yes^     ^No^     ^Maybe^
-^^^^^^^^^^^^^^---------------------------------------
-^ ^ _k_ ^ ^     _f_ollow  _i_nsert _c_: calling %s(if ivy-calling \"on\" \"off\")
-_h_ ^^ _l_     _d_one    _o_ops   _m_: matcher %s(if (eq ivy--regex-function 'ivy--regex-fuzzy) \"fuzzy\" \"ivy\")
-^ ^ _j_ ^ ^
+^^^^^^          ^Yes^     ^No^     ^Maybe^           ^Action^
+^^^^^^^^^^^^^^---------------------------------------------------
+^ ^ _k_ ^ ^     _f_ollow  _i_nsert _c_: calling %s(if ivy-calling \"on\" \"off\")  _w_/_s_: %s(ivy-action-name)
+_h_ ^+^ _l_     _d_one    _o_ops   _m_: matcher %s(if (eq ivy--regex-function 'ivy--regex-fuzzy) \"fuzzy\" \"ivy\")
+^ ^ _j_ ^ ^     _g_o      ^ ^      _<_/_>_: shrink/grow window
 "
   ;; arrows
   ("h" ivy-beginning-of-buffer)
@@ -60,11 +60,20 @@ _h_ ^✜^ _l_     _d_one    _o_ops   _m_: matcher %s(if (eq ivy--regex-function
   ("l" ivy-end-of-buffer)
   ;; actions
   ("o" keyboard-escape-quit :exit t)
+  ("C-g" keyboard-escape-quit :exit t)
   ("i" nil)
+  ("C-o" nil)
   ("f" ivy-alt-done :exit nil)
+  ("C-j" ivy-alt-done :exit nil)
   ("d" ivy-done :exit t)
+  ("g" ivy-call)
+  ("C-m" ivy-done :exit t)
   ("c" ivy-toggle-calling)
-  ("m" ivy-toggle-fuzzy))
+  ("m" ivy-toggle-fuzzy)
+  (">" ivy-minibuffer-grow)
+  ("<" ivy-minibuffer-shrink)
+  ("w" ivy-prev-action)
+  ("s" ivy-next-action))
 
 (provide 'ivy-hydra)