girishji / autosuggest.vim

Autocompletion for Vim's command-line.
MIT License
59 stars 4 forks source link

RFE: bind a key to explicitly show the completion menu (as in "onspace")? #11

Closed intelfx closed 18 hours ago

intelfx commented 1 week ago

Hi,

I'm trying out this plugin and it seems it's just one step away from being what I've really wanted all this time.

Instead of using options.cmd.onspace to enumerate all commands that I ever want to come with "auto-auto-completion", would it be possible to bind a key (like \<Leader>Tab, or S-Tab, or just the normal Tab) to show the completion menu for the current context explicitly?

Of course there is already the built-in Vim completion menu that is spawned via Tab, but it has different behaviors than the menu that is auto-spawned by this plugin via "onspace". Basically, I want a key to spawn the completion menu but 1) not auto-insert the first match and 2) fuzzily auto-update the menu based on the characters typed after the spawn event.

Would it be possible to do this with autosuggest.vim? Or am I horribly overthinking everything?

intelfx commented 1 week ago

I did an ugliest of hacks to kinda sorta emulate what I wanted here (see second mentioned commit, the first one is even uglier) — but it messes up command line rendering and flickers a lot. Any ideas how to do this right?

girishji commented 1 week ago

I'll get to this soon. We have a small baby and he needs lots of attention.

intelfx commented 1 week ago

No worries at all! Family takes the highest priority :-)

girishji commented 1 week ago

Thanks! Please try now. I made <tab> do autocomplete when alwayson is false. It is a new option for cmd-complete (default is 'true'). Only preliminary testing done. Let me know if it misbehaves.

edit: I can include your solution (<s-tab>) also, if it helps.