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?

2
  • 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 for this. If you urgently require this functionality, then you could choose to replace vertico by Ivy for now. You can still use consult and marginalia etc. with Ivy I think (not sure about marginalia)... Commented Dec 22, 2022 at 16:12
  • A solution/explanation has been provided in the issue here (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...) Commented Dec 27, 2022 at 10:49

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.