dotfiles/.config/nvim/lua/plugins/cmp.lua

26 lines
624 B
Lua

local cmp = require('cmp')
cmp.setup{
sources = {
{ name = 'nvim_lsp' },
{ name = 'path' },
{ name = 'buffer', option = { keyword_length = 4 }, },
},
mapping = {
['<CR>'] = cmp.mapping.confirm({}),
['<Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end,
['<S-Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end,
},
}