oantolin / live-completions

Live updating of the *Completions* buffer
GNU General Public License v3.0
27 stars 3 forks source link

Support for *Completions* buffer movement/selection (C-n/C-p) in minibuffer? #7

Closed MicahElliott closed 3 years ago

MicahElliott commented 3 years ago

The workflow with *Completions* seems to be to type a few characters (using Orderless) in the minibuffer to get down to a smallish number of candidates. Then, you either type a fair amount more to get down to a single candidate and RET, OR hit M-v to move focus up to *Completions* buffer and hit C-n a few times till you get to the one you want and then RET.

It'd be nice to be able to do C-n/C-p while in minibuffer, and not have to do the M-v (never have to visit *Completions* buffer). Any obstacles to adding this? Or is my described workflow missing something? It seems a bit tedious.

I also don't understand why in minibuffer, I see in *Completions* buffer one candidate highlighted (must be "forceable candidate"), but I can't hit RET to use it -- still have to keep typing till I get down to one candidate. IOW, what does the highlight suggest, and is there a way to use it?

oantolin commented 3 years ago

The highlighted candidate is that which would be inserted into the minibuffer by minibuffer-force-complete and would be immediately used by minibuffer-force-complete-and-exit. You might want to bind the latter to RET in minibuffer-local-completion-map (and maybe bind minibuffer-force-complete to something too, like C-M-i or <backtab>).

oantolin commented 3 years ago

About using C-n and C-p directly from the minibuffer, I don't think there's anything built-in you could directly use for this, but it wouldn't be hard to implement something. In fact, I believe I saw a package very similar to this one that does include that. Let me see if I can find it and you may be able to simply switch to it.

oantolin commented 3 years ago

Also, you might like to use avy to quickly select a completion. You can try my avy-completion library for that.

oantolin commented 3 years ago

Found it! The package I meant is Vcomplete, it is pretty similar to this package, but also implements C-n and C-p to move among the candidates. I recommend you give it a try and switch if you prefer it.

oantolin commented 3 years ago

I'm closing this issue, because I don't personally plan to implement this feature when I can simply point people to Vcomplete. But I am open to pull requests.

MicahElliott commented 3 years ago

Thanks as always for all the helpful details, Omar! I'll try/look into each of these that you've mentioned.