about summary refs log tree commit diff stats
path: root/.emacs.d/lisp/init-minibuffer.el
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2021-09-01 10:34:46 +0100
committerDavid Morgan <djm_uk@protonmail.com>2021-09-01 10:34:46 +0100
commita58ad8889902dfb4d1d9262e619aefa96ab63837 (patch)
tree87cf6fdaefca0c496cffb5d4d37b1de47adf4053 /.emacs.d/lisp/init-minibuffer.el
parent61d2779ec3285df47ede87422a1d684ead8c88f0 (diff)
downloaddotfiles-a58ad8889902dfb4d1d9262e619aefa96ab63837.tar.gz
Add embark preview to minibuffer
Diffstat (limited to '.emacs.d/lisp/init-minibuffer.el')
-rw-r--r--.emacs.d/lisp/init-minibuffer.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/.emacs.d/lisp/init-minibuffer.el b/.emacs.d/lisp/init-minibuffer.el
index 051f285..e5c7ce6 100644
--- a/.emacs.d/lisp/init-minibuffer.el
+++ b/.emacs.d/lisp/init-minibuffer.el
@@ -312,11 +312,20 @@
    ("C-." . embark-dwim)
    ("C-c C-o" . embark-export)
    ("C-h b" . embark-bindings)
-   ("C-h B" . describe-bindings))
+   ("C-h B" . describe-bindings)
+   (:map minibuffer-local-map
+         ("M-." . embark-preview)))
   :init
-  ;; Optionally replace the key help with a completing-read interface
   (setq prefix-help-command #'embark-prefix-help-command)
   :config
+  ;; (define-key minibuffer-local-map (kbd "M-.") #'embark-preview)
+  (defun embark-preview ()
+    (interactive)
+    (unless (bound-and-true-p consult--preview-function) ;; Disable preview for Consult commands
+      (save-selected-window
+        (let ((embark-quit-after-action))
+          (embark-default-action)))))
+
   ;; Hide the mode line of the Embark live/completions buffers
   (add-to-list 'display-buffer-alist
                '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"