From 769926dee8bed6be8278dfb3f540ff0d376fbbc6 Mon Sep 17 00:00:00 2001 From: David Morgan Date: Mon, 19 Jul 2021 16:53:34 +0100 Subject: Tweak CIDER config and add more vertico stuff --- emacs-prelude/personal/lisp/init-completion.el | 33 +++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'emacs-prelude/personal/lisp/init-completion.el') diff --git a/emacs-prelude/personal/lisp/init-completion.el b/emacs-prelude/personal/lisp/init-completion.el index 0cf2087..bbc5e21 100644 --- a/emacs-prelude/personal/lisp/init-completion.el +++ b/emacs-prelude/personal/lisp/init-completion.el @@ -101,7 +101,38 @@ (if (= vertico--index index) (propertize "ยป " 'face 'vertico-current) " ") - cand)))) + cand))) + :config + (defun down-from-outside () + "Move to next candidate in minibuffer, even when minibuffer isn't selected." + (interactive) + (with-selected-window (active-minibuffer-window) + (execute-kbd-macro [down]))) + + (defun up-from-outside () + "Move to previous candidate in minibuffer, even when minibuffer isn't selected." + (interactive) + (with-selected-window (active-minibuffer-window) + (execute-kbd-macro [up]))) + + (defun preview-from-outside () + "Preview the selected candidate, even when minibuffer isn't selected." + (interactive) + (with-selected-window (active-minibuffer-window) + (execute-kbd-macro (kbd "M-.")))) + + (defun to-and-fro-minibuffer () + "Go back and forth between minibuffer and other window." + (interactive) + (if (window-minibuffer-p (selected-window)) + (select-window (minibuffer-selected-window)) + (select-window (active-minibuffer-window)))) + + (key-chord-define-global "XX" 'to-and-fro-minibuffer) + (key-chord-define-global ">>" 'preview-from-outside) + :bind (("C-M-<" . up-from-outside) + ("C-M->" . down-from-outside) + ("M-+" . preview-from-outside))) (prelude-require-package 'consult) (use-package consult -- cgit 1.4.1-2-gfad0