You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何禁用cmp插件自动补全列表中的代码描述?

移除NvChad中nvim-cmp代码描述弹窗的解决办法
  • 定位到NvChad自定义配置里的cmp配置文件,通常路径是custom/plugins/configs/cmp.lua
  • 在cmp.setup()的配置块中添加或修改window选项,关闭文档预览窗口:
cmp.setup({
  -- 保留你原有其他配置
  window = {
    documentation = false, -- 直接关闭补全时弹出的代码描述窗口
    -- 要是想保留功能但隐藏窗口,可替换为以下配置:
    -- documentation = {
    --   max_height = 0,
    --   max_width = 0,
    -- }
  },
  -- 保留你原有其他配置
})
  • 保存配置后重启Neovim,即可移除干扰你的黄色标注代码描述。

如果以上方法没效果,有可能是LSP的inlay hints导致的,可在LSP配置中关闭:

-- 在custom/plugins/configs/lspconfig.lua的on_attach函数中添加
local on_attach = function(client, bufnr)
  -- 保留原有其他on_attach配置
  client.server_capabilities.inlayHintProvider = false
end

内容的提问来源于stack exchange,提问作者DrShahinstein

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.01 04:33:18