mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-31 07:09:23 +02:00
fix(luasnip): only use user snippets if the folder exists (#2481)
This commit is contained in:
parent
10c7753d8e
commit
1ae89bee93
1 changed files with 8 additions and 4 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue