Changed vsnip to luasnip

This commit is contained in:
2024-07-10 10:48:21 +09:00
parent b25f3bfd4e
commit 95332ba671
+5 -2
View File
@@ -7,7 +7,8 @@ return {
cmp.setup({ cmp.setup({
snippet = { snippet = {
expand = function(args) expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- vim.fn["vsnip#anonymous"](args.body)
require("luasnip").lsp_expand(args.body)
end end
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
@@ -19,7 +20,8 @@ return {
}), }),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = "nvim_lsp" }, { name = "nvim_lsp" },
{ name = "vsnip" } -- { name = "vsnip" }
{ name = "luasnip" }
}, { }, {
{ name = "buffer" } { name = "buffer" }
}) })
@@ -46,6 +48,7 @@ return {
{ "hrsh7th/cmp-buffer" }, { "hrsh7th/cmp-buffer" },
{ "hrsh7th/cmp-path" }, { "hrsh7th/cmp-path" },
{ "hrsh7th/cmp-cmdline" }, { "hrsh7th/cmp-cmdline" },
{ "saadparwaiz1/cmp_luasnip"},
{ "hrsh7th/cmp-vsnip" }, { "hrsh7th/cmp-vsnip" },
{ "hrsh7th/vim-vsnip" }, { "hrsh7th/vim-vsnip" },
} }