Closed choucavalier closed 1 year ago
After some research it seems to be the same issue as in https://github.com/hrsh7th/nvim-cmp/issues/916
I've set the following mappings and it does not solve the problem
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-cmdline',
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
},
config = function()
local cmp = require("cmp")
cmp.setup({
snippet = {
expand = function(args) require("luasnip").lsp_expand(args.body) end,
},
mappings = cmp.mapping.preset.insert({
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-p>"] = cmp.mapping.select_prev_item(),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "cmdline" },
{ name = "path" },
{ name = "buffer" },
{ name = "luasnip" },
}),
})
end,
},
:set paste?
shows that I have it correctly set to nopaste
goddamn it, this was due to me writing mappings
instead of mapping
in the setup... closing
FAQ
Announcement
Minimal reproducible full config
Description
Pressing
<C-n>
makes the nvim-cmp menu disappear and switches back to some other default menu. I don't know what's happeningSteps to reproduce
Use my nvim-cmp config
Expected behavior
I would expect the nvim-cmp to be used instead, even though I switch to the next item in the list
Actual behavior
Some other menu appears, which seems to be the default menu.
Additional context
No response