From e7696893f45675f752efd0fd7b1dc318101eead8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alois=20Jan=C3=AD=C4=8Dek?= Date: Tue, 15 Dec 2020 00:10:29 +0100 Subject: [PATCH 1/2] ivy-read-action-function = ivy-hydra-read-action Use hydra to read user action when calling `ivy-dispatching-done` --- modules/completion/ivy/config.el | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index ab23c5572..72d0a23c5 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -59,6 +59,7 @@ results buffer.") (setq ivy-height 17 ivy-wrap t ivy-fixed-height-minibuffer t + ivy-read-action-function #'ivy-hydra-read-action ivy-read-action-format-function #'ivy-read-action-format-columns projectile-completion-system 'ivy ;; don't show recent files in switch-buffer From 8afd8a6ce89606a72b53fd693bc512049da6c0a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alois=20Jan=C3=AD=C4=8Dek?= Date: Tue, 15 Dec 2020 00:28:50 +0100 Subject: [PATCH 2/2] Restore user ability to toggle ivy related hydras There are two hydras that can be opened from ivy interface: 1. `ivy-dispatching-done' (doom key: "C-o", vanilla key: "M-o") 2. `hydra-ivy/body' (doom key: "M-o", vanilla key: "C-o") Original behavior is that they both can be exited / toggled by the same key they were opened. This commit restores the original behaviour but does it without reverting the decision to swap the "C-o" and "M-o" key bindings. --- modules/completion/ivy/config.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index 72d0a23c5..fd5867ccb 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -96,6 +96,12 @@ results buffer.") (after! yasnippet (add-hook 'yas-prompt-functions #'+ivy-yas-prompt-fn)) + (after! ivy-hydra + ;; Ensure `ivy-dispatching-done' and `hydra-ivy/body' hydras can be + ;; exited / toggled by the same key binding they were opened + (add-to-list 'ivy-dispatching-done-hydra-exit-keys '("C-o" nil)) + (defhydra+ hydra-ivy () ("M-o" nil))) + (define-key! ivy-minibuffer-map [remap doom/delete-backward-word] #'ivy-backward-kill-word "C-c C-e" #'+ivy/woccur