Adding lua snip to lsp-cmp

This commit is contained in:
danielweber 2024-04-25 10:39:18 -04:00
parent 66b81ee300
commit 2205333a0e

View File

@ -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),