I'm using lspkind and nvim-cmp with Neovim 0.7.
When <C-n>
or <C-p>
is pressed to scroll through the items from the list of possible completions it gets completely overwritten by the standard completion suggestions. See link for an example.
Why does it change from lspkind suggestions to basic completion?
Why do I get --keyword completion (^N^P) back to original
?
I had the same issue. I solved it by adding
['<C-n>'] = cmp.mapping(cmp.mapping.select_next_item()),
['<C-p>'] = cmp.mapping(cmp.mapping.select_prev_item()),
inside of the mapping list of the LUA config (I'm not actually sure this is a list I only use LUA for Nvim)
mapping = { ...,
['<C-n>'] = cmp.mapping(cmp.mapping.select_next_item()),
['<C-p>'] = cmp.mapping(cmp.mapping.select_prev_item()),
...
The reason for this issue coming up in the first place is that (from the config I copied) the select_next_item/select_prev_item functions simply wasn't bound so there was nothing to overwrite the standard completion.
I found these functions in the cmp documentation.