Skip to content

Commit

Permalink
fix(luasnip): only use user snippets if the folder exists (#2481)
Browse files Browse the repository at this point in the history
  • Loading branch information
abzcoding committed Apr 18, 2022
1 parent 10c7753 commit 1ae89be
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lua/lvim/plugins.lua
Expand Up @@ -70,12 +70,16 @@ local core_plugins = {
"L3MON4D3/LuaSnip",
config = function()
local utils = require "lvim.utils"
local paths = {
utils.join_paths(get_runtime_dir(), "site", "pack", "packer", "start", "friendly-snippets"),
}
local user_snippets = utils.join_paths(get_config_dir(), "snippets")
if utils.is_directory(user_snippets) then
paths[#paths + 1] = user_snippets
end
require("luasnip.loaders.from_lua").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load {
paths = {
utils.join_paths(get_config_dir(), "snippets"),
utils.join_paths(get_runtime_dir(), "site", "pack", "packer", "start", "friendly-snippets"),
},
paths = paths,
}
require("luasnip.loaders.from_snipmate").lazy_load()
end,
Expand Down

0 comments on commit 1ae89be

Please sign in to comment.