nvim-cmp icon indicating copy to clipboard operation
nvim-cmp copied to clipboard

Minimum number of chars for completion

Open AllergicMushroom opened this issue 1 year ago • 2 comments

I am trying to construct my Neovim setup with nvim-cmp and I want to configure it so that the floating window of propositions only opens after two letters of the word are typed.

I tried the following :

require('cmp').setup({ ... completion = { keyword_length = 2 } })

It almost worked. If I type two letters, the floating window appears with useful suggestions. If I type one letter, the floating window does not appear. If I type nothing, the floating window appears with a lot of bloat. I'm trying to get rid of this case as well.

Because I use nvim-cmp and copilot, both with the same key for confirming, the floating window appearing when nothing is typed is extremely cumbersome.

Is there another setting for the floating window appearing only after x letters have been typed ?

AllergicMushroom avatar May 12 '24 14:05 AllergicMushroom

I think you have to set the keyword_length on each completion source.

MariaSolOs avatar Aug 18 '24 16:08 MariaSolOs

I tried doing that, to no avail.

However, I just noticed that what I first tried works perfectly, except when I also load the cmp-cmdline package.

I think this issue can be closed.

AllergicMushroom avatar Sep 06 '24 12:09 AllergicMushroom