36 lines
953 B
Lua
36 lines
953 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
|