1
0
Fork 0
chezmoi/dot_config/nvim/lua/configs/nvim-cmp.lua
2022-11-03 15:05:24 +01:00

36 lines
807 B
Lua

local M = {}
function M.setup()
local cmp = require 'cmp'
cmp.setup({
-- documentation = true,
sources = {
{ name = 'nvim_lsp' },
{ name = 'nvim_lua' },
{ name = 'buffer' },
{ name = 'path' },
-- { name = 'nvim_lsp_signature_help' },
},
formatting = {
format = require 'lspkind'.cmp_format({
-- mode = 'symbol',
}),
},
window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<CR>'] = cmp.mapping.confirm({ select = false })
}),
snippet = {
expand = function(args)
-- For `vsnip` user.
vim.fn['vsnip#anonymous'](args.body) -- For `vsnip` user.
end
}
})
end
return M