Is your feature request about something that is currently impossible or hard to do? Please describe the problem.
From :h 'completeopt':
Only "fuzzy", "longest", "popup", "preinsert" and "preview" have an effect when 'autocomplete' is enabled.
It's very helpful to configure set autocomplete completeopt=menuone,noinsert,popup,fuzzy: the completion menu is displayed automatically, with the first item preselected, so we can accept the first match with a single <C-Y> key (in my case, <Tab>, which I've remapped to <C-Y> when the popup menu is visible). The right item will land on the first position in the popup menu as we type, and the fuzzy option allows us to type just a few characters to get a perfect match.
It is unfortunate that noselect is implied by autocomplete, because now we need two keys to accept an item.
Describe the solution you'd like
noinsert should work in combination with autocomplete.
Alternatively, provide a function to check if an item is selected (similar to :h pumvisible(), e.g. pumselected(), which could return the index of the selected item, or -1 if no item is selected). We could then use this in a mapping:
inoremap <expr> <Tab> pumvisible() ? (pumselected() != -1 ? '<C-Y>' : '<C-N><C-Y>') : '<Tab>'
Describe alternatives you've considered
preinsert (the proposed alternative in #18340) has a completely different behavior.
Disabling autocomplete requires triggering the completion manually all the time, which is really annoying.
The implied noselect behavior with autocomplete requires two key bindings to accept an item, which is slightly annoying.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()