From 2205333a0e1cf606a77c41ed88fd2a8658afad56 Mon Sep 17 00:00:00 2001 From: danielweber Date: Thu, 25 Apr 2024 10:39:18 -0400 Subject: [PATCH] Adding lua snip to lsp-cmp --- after/plugin/lsp.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 2cd461a..1fffffd 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -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({ [''] = cmp.mapping.select_prev_item(cmp_select),