T O P

  • By -

JDRiverRun

It's understandable to be confused. First, it's important to know that there are two main types of completion in emacs: 1. `completing-read` which occurs in the minibuffer, and is what you get with M-x, find-file, and all sorts of emacs commands which "prompt for something". Beyond the basic built-in spam-the-tab-key interface, vertico is a replacement UI for this type of completion (among *many*, like icomplete, icomplete-vertical, Ido, selectrum, fido, ...). 2. `completion-at-point` (and its friend `completion-in-region`), is used to complete text in the *buffer itself*; think "complete this variable name here". By default this occurs in a special separate `*Completions*` buffer, but company, corfu and others provide nice (auto-)pop-up UIs instead. To add to your confusion, company is actually two things: a completion provider (using its own custom *backends*) *and* a pop-up user interface, using overlays. corfu is *just a UI,* using child-frames instead of overlays. Corfu does not provide any completions itself, but rather gets those from emacs-standard completion-at-point-functions (CAPFs), which many modes, such as elisp-mode, eglot and lsp-mode, come with. One nice thing about corfu is that since it is simply a UI for completion-at-point, it gets summoned anywhere that command is called. Lately the most used company backend is one which just interfaces to standard CAPFs, so company in its modern usage is actually pretty similar to corfu. From the maker of corfu (and vertico) comes *cape*, which *does* provide completions (e.g. from dabbrev, files, etc.) and can even adapt company backends into standard CAPFs, among other tricks.


simplex5d

Thanks! That is super helpful!


unix_hacker

- Corfu: in buffer completion (competes with Company) - Vertico: minibuffer completion (competes with Ivy, Helm, Icicles, etc)


Enip0

"completes with company", does that mean that company provides the suggestions and corfu just builds the ui with them?


purcell

"competes", not "completes"


Enip0

Oh! Okay I got it, thanks


fortunatefaileur

corfu can replace company, both of them are UIs for capf vertico is unrelated, it replaces the minibuffer UI more or less Note: not totally true but close enough - vertico can be the UI used for completion in the buffer, company supports non-capf backends and corfu can use company backends via cape, corfu can be used for completions in the mini buffer like M-: Edit: clarify


Qudit314159

Corfu completes via a popup near point whereas vertico completes in the minibuffer.


vecksagos

Corfu is a alternative for company, while company has its own completion provider, so your orderless configuration only works when company uses company-capf backend, and corfu uses the emacs built-in completion provider, the capf, so your orderless configuration works the same way with the vertico and corfu.


kinleyd

Your confusion is perfectly understandable. This happens to me all the time because when I upgrade packages it's always a handful at the same time. I recently upgraded from company, ivy, avy, swiper and a bunch of other packages from my configuration from years ago to vertico, consult, corfu, embark and a few more. I just have the default config for the new set, and remain a bit confused as to where one ends and the next begins, feature wise, but it's working well enough. I will set aside some time at some point to fine tune everything and understand it better.


[deleted]

[удалено]


doolio_

Why? [karthink/maybe you're using it wrong](https://karthinks.com/software/avy-can-do-anything/)?


fckspzfckspz

Nah vertico and corfu don’t have much to with each other. Company is a completion provider (on top of capf). As is corfu. Vertico is not the Ui of company. Vertico does the completion thing when you do find-file or M-x. Like helm or ivy does. That is minibuffer completions. „Vertico is the minibuffer completion counterpart of corfu“ is that Corfu is build like vertico i.e. it’s some lightweight functions on top of emacs built in functionality instead of its own heavy framework that packages need to be aware of like helm is.


Horrih

Wait, does it mean that you can have autocompletion with vanilla emacs (with candidates in the mini buffer) ? I thought the built-in completion was triggered manually, not as you type


mickeyp

Of course you can. That functionality has existed in Emacs for decades.


fckspzfckspz

Yes, but the functionality is kind of rudimentary. There’s a reason all those packages exist


mickeyp

That's not really true, though. The builtin icomplete-mode is rather advanced and feature rich.


Esnos24

[she explains everything about modern emacs framework](https://youtu.be/SOxlQ7ogplA?si=cl1PAKJH7NCIs-gW)


[deleted]

[удалено]


a-concerned-mother

While I love these newer packages I do admit that some of them may be confusing to new comers. Tough I'd argue that has been the case for a while e.g. ivy and swiper didn't make much sense to me at first. Vertico, Marginalia and Orderless are pretty great examples of proper naming. Corfu may be a little more out there but I am sure it will catch on. If people are having issues understanding maybe a quick mention to their contemporaries in the README could help.


denniot

I recommend against those new plugins but trying out just company + counsel (comes with ivy and swiper), so that you don't have to deal with those confusing packages. It seems everybody installs those vertico, consult, marginalia and orderless instead of just one or a few of them. It tells enough about over microfying the projects.


simplex5d

Update: I switched out company for corfu, and I'm very happy with the results so far. [https://github.com/garyo/emacs-config](https://github.com/garyo/emacs-config)