Prefix current candidate in Vertico with ":"

This commit is contained in:
Case Duckworth 2021-08-11 22:06:57 -05:00
parent eb46c6a277
commit 79eb4dce2b
1 changed files with 9 additions and 10 deletions

19
init.el
View File

@ -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"