1

I am using evil-mode and now want to use vertico for completion. I've got it setup so it works when I hit M-x, C-x C-f, C-x C-b, etc. However, it doesn't work in evil's ex-prompt (the command prompt started by hitting :).

How do i tell vertico to also complete comands in the ex prompt?

laalsaas
  • 31
  • 3
  • Looking into the source of the Vertico, it seems to me that Vertico does not support this currently (it seems to support only functions that use `completing-read-default/multiple`, while `evil-ex` uses `read-from-minibuffer`). Therefore, I guess you can better open an issue at [vertico](https://github.com/minad/vertico) for this. If you urgently require this functionality, then you could choose to replace vertico by [Ivy](https://github.com/abo-abo/swiper) for now. You can still use consult and marginalia etc. with Ivy I think (not sure about marginalia)... – dalanicolai Dec 22 '22 at 16:12
  • A solution/explanation has been provided in [the issue here](https://github.com/minad/vertico/issues/308#issuecomment-1363413477) (I am not sure, why @minad mentions that the comment here is confusing things, as his solution/explanation confirms that Vertico, by itself, does not support this. But anyway, it provides a nice explanation and it is nice that support is provided via the consult package...) – dalanicolai Dec 27 '22 at 10:49

1 Answers1

2

I asked the same question on github, and this is the answer i got:

If you press TAB in the evil-ex prompt you will invoke completion-at-point. This command triggers in-buffer completion. Vertico doesn't directly support in-buffer completion, only minibuffer completion.

In order to still use Vertico as an in-buffer completion UI, you can use consult-completion-in-region from my Consult package. This function does nothing else than redirecting the in-buffer completion to the minibuffer. In this case, since we are already in a minibuffer, it will start a recursive minibuffer. Ivy does the same.

(setq completion-in-region-function 'consult-completion-in-region)

See https://github.com/minad/vertico#completion-at-point-and-completion-in-region for more details. As an alternative for in-buffer completion you could also try the Corfu completion UI, see then https://github.com/minad/corfu#completing-in-the-minibuffer.

laalsaas
  • 31
  • 3