hrsh7th / nvim-cmp

A completion plugin for neovim coded in Lua.
MIT License
8.14k stars 405 forks source link

Question: How to make nvim-cmp auto insert the firsts item/when no other options remain like company-mode does? #2058

Closed leimath closed 1 month ago

leimath commented 1 month ago

Hi! I am migrating from company-mode in emacs and it had this functionality that when the guess is fully correct/there are no other options in the window, it auto inserts the first item (aka the only item) and then only requires <tab> to be pressed to complete it. Is this sort functionality doable with nvim-cmp if so how? Thank you.

leimath commented 1 month ago

https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings#confirm-candidate-on-tab-immediately-when-theres-only-one-completion-entry

This gets close to what I want. Still no ghost text-ability but this works.