Adding lua snip to lsp-cmp
This commit is contained in:
parent
66b81ee300
commit
2205333a0e
@ -64,12 +64,19 @@ require('mason-lspconfig').setup({
|
||||
|
||||
local cmp = require('cmp')
|
||||
local cmp_select = {behavior = cmp.SelectBehavior.Select}
|
||||
local luasnip= require('luasnip')
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
sources = {
|
||||
{name = 'path'},
|
||||
{name = 'nvim_lsp'},
|
||||
{name = 'nvim_lua'},
|
||||
{name = 'luasnip'},
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
|
Loading…
Reference in New Issue
Block a user