In an article about my Emacs config this summer, I wrote that my completion stack was Ivy, Counsel and Swiper rather than "the newer Vertico-and-consult combination everyone reaches for now", because the old stack still did the job and switching wasn't worth the churn. In early October I switched anyway, around the same time as setting Emacs up properly for PHP work. This is what replaced what, and the one design difference that made the new stack worth the change.
The difference: built on Emacs, not beside it
Ivy's README describes it as a generic completion mechanism for Emacs, and Counsel as a collection of Ivy-enhanced versions of common Emacs commands. The stack is built around Ivy: the enhanced commands are Ivy's, and their behavior is tuned through Ivy's own settings.
The newer packages split that job into small pieces that all build on Emacs' own completion system. Vertico's README describes it as a vertical completion UI based on the default completion system, which, by reusing the built-in facilities, is fully compatible with Emacs' own completion commands. Consult describes itself as search and navigation commands built on completing-read. Matching is a completion style, Orderless, plugged into the standard completion-styles variable. Because each piece sits on the same built-in interfaces, any command that uses completing-read gets Vertico's interface, Orderless matching and Marginalia's annotations, whether its author ever heard of them or not.
What replaced what
The change was one commit on 3 October. In the minibuffer:
- Vertico replaced
ivy-modeas the vertical candidate list.savehist-mode, built into Emacs, keeps the minibuffer history Vertico sorts by. - Orderless replaced Ivy's per-command regex builders. The old config chose a matching style per command, regex-plus for Swiper and the grep commands and fuzzy for everything else. Now there's one style for everything:
(completion-styles '(orderless basic)), with one exception for file names,basicandpartial-completion, the same kind of exception Orderless's own README shows. - Marginalia adds annotations next to candidates in the minibuffer, such as a command's documentation or a file's details.
- Consult replaced the Counsel commands.
C-smoved fromcounsel-grep-or-swipertoconsult-line,C-x btoconsult-buffer, and there are bindings forconsult-ripgrep,consult-find,consult-imenu,consult-flymakeandconsult-yank-pop. Xref results, which the language server produces for "find references", also go through Consult. - Embark is new rather than a replacement:
C-.acts on the candidate under the cursor, andC-h Blists the key bindings available right now.
Completion in the buffer: Corfu and Cape
Completion while typing was already Corfu before the switch, so that part changed less. Corfu shows its popup automatically, and with corfu-quit-no-match set to separator it closes when nothing matches unless you've typed a separator to keep filtering. The new piece is Cape, which adds completion sources: cape-dabbrev for words from open buffers and cape-file for file names, both added to completion-at-point-functions so they sit next to whatever the language server offers.
One detail carried over: Corfu uses a custom completion style that only does literal substring matching, set buffer-locally when Corfu turns on, so in-buffer completion doesn't use Orderless' fuzzier dispatchers. I explained why in an earlier article about this config's completion frameworks.
Was the churn worth it?
The cost was real but small: a handful of key bindings to relearn and a section of config rewritten. The gain is mostly that there's nothing framework-specific left to maintain. The old config had settings that only existed to tune Ivy's behavior per command; the new one sets a completion style once and configures each command where it's bound. Given that the rest of the October changes moved the PHP setup onto Emacs' built-in pieces too, Eglot and php-ts-mode, it made sense for completion to sit on the built-in interfaces as well.
So the earlier article was right at the time it was written: the old stack worked. What changed was everything around it.
Leave a comment
Comments are reviewed before they appear.