neovim: move luasnip config back to it's module

This commit is contained in:
Vladan Popovic 2024-10-01 21:39:06 +02:00
parent 384d023ead
commit 8e63b0f857
2 changed files with 15 additions and 15 deletions

View file

@ -24,21 +24,6 @@ require('packer').startup(function()
}
}
use { 'L3MON4D3/LuaSnip',
config = function()
local snippet_path = os.getenv("HOME") .. "/.config/nvim/snippets/"
if not vim.tbl_contains(vim.opt.rtp:get(), snippet_path) then
vim.opt.rtp:append(snippet_path)
end
require("luasnip").config.set_config({
history = true,
updateevents = "TextChanged,TextChangedI",
delete_check_events = "TextChanged,InsertLeave",
})
require("luasnip.loaders.from_lua").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_snipmate").lazy_load()
end,
requires = {
{ "rafamadriz/friendly-snippets" },
{ 'saadparwaiz1/cmp_luasnip' },

View file

@ -10,3 +10,18 @@ vim.keymap.set({ "i", "s" }, "<C-E>", function()
luasnip.change_choice(1)
end
end, { silent = true })
local snippet_path = os.getenv("HOME") .. "/.config/nvim/snippets/"
if not vim.tbl_contains(vim.opt.rtp:get(), snippet_path) then
vim.opt.rtp:append(snippet_path)
end
luasnip.config.set_config({
history = true,
updateevents = "TextChanged,TextChangedI",
delete_check_events = "TextChanged,InsertLeave",
})
require("luasnip.loaders.from_lua").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_snipmate").lazy_load()