From 43570301009c10428c80385cb1f23f3908416032 Mon Sep 17 00:00:00 2001 From: Thanh Date: Mon, 4 Jul 2022 22:50:40 -0600 Subject: [PATCH] [compleseus] improve M-n --- layers/+completion/compleseus/funcs.el | 8 ++++++++ layers/+completion/compleseus/packages.el | 3 +++ 2 files changed, 11 insertions(+) diff --git a/layers/+completion/compleseus/funcs.el b/layers/+completion/compleseus/funcs.el index 57b9df4bc..ca7f4e53a 100644 --- a/layers/+completion/compleseus/funcs.el +++ b/layers/+completion/compleseus/funcs.el @@ -191,6 +191,14 @@ targets." (remq #'spacemacs/embark-which-key-indicator embark-indicators))) (apply fn args))) +(defun spacemacs/minibuffer-default-add-function () + "See `minibuffer-default-add-function'" + (with-selected-window (minibuffer-selected-window) + (delete-dups + (delq nil + (list (thing-at-point 'symbol) + (thing-at-point 'list) + (thing-at-point-url-at-point)))))) (defun spacemacs/consult-jump-in-buffer () "Jump in buffer with `consult-imenu' or `consult-org-heading' if in org-mode" diff --git a/layers/+completion/compleseus/packages.el b/layers/+completion/compleseus/packages.el index 0c45b0c1e..ae8b7f478 100644 --- a/layers/+completion/compleseus/packages.el +++ b/layers/+completion/compleseus/packages.el @@ -236,6 +236,9 @@ ;; You may want to use `embark-prefix-help-command' or which-key instead. ;; (define-key consult-narrow-map (vconcat consult-narrow-key "?") #'consult-narrow-help) + ;; Make M-n as smart as ivy and helm equivalents + (setq minibuffer-default-add-function 'spacemacs/minibuffer-default-add-function) + ;; Optionally configure a function which returns the project root directory. (setq consult-project-root-function (lambda ()