feat(luasnip): added snippet_paths option for luasnip

This commit is contained in:
Manas Mengle 2022-06-27 15:58:14 +01:00 committed by siduck
parent 9ccc95ea6c
commit 5a3fcd7326
2 changed files with 6 additions and 1 deletions

View File

@ -43,6 +43,9 @@ M.plugins = {
lspconfig = {
setup_lspconf = "", -- path of lspconfig file
},
luasnip = {
snippet_paths = {""}, -- list of custom snippet locations
},
},
}

View File

@ -1,6 +1,7 @@
local M = {}
local load_override = require("core.utils").load_override
local load_config = require("core.utils").load_config
M.autopairs = function()
local present1, autopairs = pcall(require, "nvim-autopairs")
@ -112,7 +113,8 @@ M.luasnip = function()
options = load_override(options, "L3MON4D3/LuaSnip")
luasnip.config.set_config(options)
require("luasnip.loaders.from_vscode").lazy_load()
snippet_paths = load_config().plugins.options.luasnip.snippet_paths
require("luasnip.loaders.from_vscode").lazy_load({ paths = snippet_paths })
vim.api.nvim_create_autocmd("InsertLeave", {
callback = function()