Reenabled vertico, because Fido-mode is unstable

This commit is contained in:
Aleksandr Lebedev 2025-02-03 00:20:37 +01:00
parent 8be34ee76b
commit 2c95089534

View file

@ -56,6 +56,7 @@
- [[#nerd-icons-completion][Nerd Icons Completion]]
- [[#buffer-move][Buffer Move]]
- [[#completions][Completions]]
- [[#vertico][Vertico]]
- [[#orderless][Orderless]]
- [[#fido-mode][Fido-mode]]
- [[#descriptions][Descriptions]]
@ -1046,6 +1047,52 @@ one, an error is signaled."
(select-window other-win))))
#+end_src
* Completions
** Vertico
[[https://github.com/minad/vertico][Vertico]] provides a performant and minimalistic vertical completion UI based on the default completion system.
#+begin_src emacs-lisp
;; Enable vertico
(use-package vertico
:ensure t
:custom
;; (vertico-scroll-margin 0) ;; Different scroll margin
;; (vertico-count 20) ;; Show more candidates
;; (vertico-resize t) ;; Grow and shrink the Vertico minibuffer
(vertico-cycle t) ;; Enable cycling for `vertico-next/previous'
:init
(vertico-mode))
(vertico-mode t) ;; enable vertico for all buffers
;; Persist history over Emacs restarts. Vertico sorts by history position.
(use-package savehist
:init
(savehist-mode))
;; A few more useful configurations...
(use-package emacs
:custom
;; Support opening new minibuffers from inside existing minibuffers.
(enable-recursive-minibuffers t)
;; Hide commands in M-x which do not work in the current mode. Vertico
;; commands are hidden in normal buffers. This setting is useful beyond
;; Vertico.
(read-extended-command-predicate #'command-completion-default-include-p)
:init
;; Add prompt indicator to `completing-read-multiple'.
;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
(defun crm-indicator (args)
(cons (format "[CRM%s] %s"
(replace-regexp-in-string
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
crm-separator)
(car args))
(cdr args)))
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
;; Do not allow the cursor in the minibuffer prompt
(setq minibuffer-prompt-properties
'(read-only t cursor-intangible t face minibuffer-prompt))
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode))
#+end_src
** Orderless
Better searching
#+begin_src emacs-lisp
@ -1062,8 +1109,10 @@ one, an error is signaled."
(completion-category-overrides '((file (styles partial-completion)))))
#+end_src
** Fido-mode
Enables fido completion in emacs.
#+begin_src emacs-lisp
Enables fido completion in emacs. It's actually cool, but...
Sometimes it hides the last result and it doesn't work good when using app launchers
#+begin_src emacs-lispp
(global-completion-preview-mode)
(fido-mode t)
(savehist-mode t)