diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 073b13d..e90e26f 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -100,7 +100,7 @@ function M.config() else fallback() end - end, { 'i', 'c', 's' }), + end, { 'i', 's' }), [''] = cmp.mapping(function(fallback) if cmp.visible() then @@ -110,7 +110,7 @@ function M.config() else fallback() end - end, { 'i', 's', 'c' }), + end, { 'i', 's' }), }, sources = { { name = 'nvim_lsp' }, @@ -121,33 +121,7 @@ function M.config() }, } cmp.setup.cmdline(':', { - mapping = { - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item { behavior = cmp.SelectBehavior.Insert } - else - cmp.complete() - cmp.select_next_item { behavior = cmp.SelectBehavior.Insert } - end - end, { 'i', 's', 'c' }), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item { behavior = cmp.SelectBehavior.Insert } - else - cmp.complete() - end - end, { 'i', 's', 'c' }), - [''] = cmp.mapping { - i = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = false }, - c = function(fallback) - if cmp.visible() then - cmp.confirm { behavior = cmp.ConfirmBehavior.Insert, select = true } - else - fallback() - end - end, - }, - }, + mapping = cmp.mapping.preset.cmdline(), sources = { { name = 'cmdline' }, { name = 'path' }, @@ -159,7 +133,6 @@ function M.config() }) cmp.setup.cmdline('/', { - completion = { autocomplete = true }, sources = { { name = 'buffer' }, },