diff --git a/lua/plugin/config/cmp.lua b/lua/plugin/config/cmp.lua index 36c136e..bfcb902 100644 --- a/lua/plugin/config/cmp.lua +++ b/lua/plugin/config/cmp.lua @@ -63,7 +63,6 @@ cmp.setup({ [""] = cmp.mapping.select_next_item(), [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), [""] = cmp.mapping.close(), [""] = cmp.mapping( function (fallback) @@ -92,7 +91,6 @@ cmp.setup({ end end, { "i", "s", } ), - [""] = cmp.mapping( function (fallback) if cmp.visible() then @@ -104,14 +102,32 @@ cmp.setup({ end end, { "i", "s", } ), + [""] = cmp.mapping( + function (fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, { "i", "s", } + ), + [""] = cmp.mapping( + function (fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end, { "i", "s", } + ), }, sources = { - -- { name = 'buffer' }, - { name = "path", }, { name = "nvim_lsp", }, + { name = "luasnip", }, + { name = "path", }, + -- { name = 'buffer' }, -- { name = 'nvim_lsp_signature_help' }, -- { name = 'nvim_lua' }, - { name = "luasnip", }, }, })