wilder.nvim
wilder.nvim copied to clipboard
Add option to select first item in but not insert it
I would love it if Wilder automatically selected the first item in the suggestion list but without inserting its text into the command-line. And calling wilder#accept_completion() would insert the text in the selected suggestion. This is in my experience how most tools that auto-complete what you're typing work.
What I'm trying to describe is kinda like what set completeopt+=noinsert does for Vim's completion menu.
Is this configurable now or would it be possible to implement as a feature?
Unfortunately this isn't possible currently.
I'll see if this is implement-able or if I have to change the pipeline architecture to accommodate this.
Wanted to double-check how set completeopt+=noinsert works: Should tabbing with wilder#next() to next/previous candidates insert text into the command-line? Or is text only inserted after wilder#accept_completion() is called?
@gelguy Honestly it doesn't really matter to me. Whichever one is easiest to implement I guess? :)
Most auto-completion tools that I've tried in Vim do insert the text after the next alternative is selected (i.e. wilder#next()), so perhaps because of consistency that would be preferred?
I've added this as part of #68 but it's not documented as I wanted to check if this is the expected behavior.
You can enable it by setting:
call wilder#set_option('noselect', 0)
I can't speak for melkster, but this does exactly what I wanted.
@dusty-phillips I have now switched to cmp-cmdline together with nvim-cmp :)