From 79eb4dce2bc2b9a19f7811036b3c4c3b64cd4336 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 11 Aug 2021 22:06:57 -0500 Subject: Prefix current candidate in Vertico with ":" --- init.el | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/init.el b/init.el index b848593..31fade2 100644 --- a/init.el +++ b/init.el @@ -1461,16 +1461,15 @@ if ripgrep is installed, otherwise `consult-grep'." (:also-load vertico-mouse) (vertico-mouse-mode +1) - ;; Workarounds! - ;; (with-eval-after-load 'org - ;; (when (version< org-version "9.5") - ;; (defun disable-selection () - ;; (when (eq minibuffer-completion-table #'org-tags-completion-function) - ;; (setq-local vertico-map minibuffer-local-completion-map - ;; completion-cycle-threshold nil - ;; completion-styles '(basic)))) - ;; (advice-add #'vertico--setup :before #'disable-selection))) - ) + ;; Prefix the current candidate with ": ". From Vertico wiki. + (advice-add #'vertico--format-candidate :around + (lambda (orig cand prefix suffix index _start) + (setq cand (funcall orig cand prefix suffix index _start)) + (concat + (if (= vertico--index index) + (propertize ": " 'face 'vertico-current) + " ") + cand)))) (setup (:straight vuiet) (:needs "youtube-dl" -- cgit 1.4.1-21-gabe81