NVIM完成菜单问题

发布于 2025-01-22 14:56:43 字数 315 浏览 7 评论 0原文

我使用Neovim 0.7的LSPKind和NVIM-CMP。

< cn>< cp>被压迫从可能的完成列表中滚动浏览项目,它将被标准完成建议完全覆盖。参见 link

为什么它会从LSPKind建议转变为基本完成? 为什么我要获得- 关键字完成(^n^p)回到原始

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

坐在坟头思考人生 2025-01-29 14:56:43

我也有同样的问题。我通过在Lua配置的映射列表中添加内部来解决它

['<C-n>'] = cmp.mapping(cmp.mapping.select_next_item()),
['<C-p>'] = cmp.mapping(cmp.mapping.select_prev_item()),

(我实际上不确定这是我只有一个列表
使用lua作为nvim)

mapping = { ...,
['<C-n>'] = cmp.mapping(cmp.mapping.select_next_item()),
['<C-p>'] = cmp.mapping(cmp.mapping.select_prev_item()),
...

首先出现此问题的原因是(从
config i复制)select_next_item/select_prev_item函数简单
没有约束,所以没有什么可以覆盖标准完成的。

我在cmp

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文