1
0
Fork 0
dotfiles/.config/nvim/lua/plugins/config/luasnip.lua
2023-01-28 19:06:51 +01:00

23 lines
655 B
Lua

local status_ok, luasnip = pcall(require, "LuaSnip")
if not status_ok then
return
end
local options = {
history = true,
updateevents = "TextChanged,TextChangedI",
}
luasnip.config.set_config(options)
require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.luasnippets_path or "" }
require("luasnip.loaders.from_vscode").lazy_load()
vim.api.nvim_create_autocmd("InsertLeave", {
callback = function()
if require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()]
and not require("luasnip").session.jump_active
then
require("luasnip").unlink_current()
end
end,
})