Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(luasnip): only use user snippets if the folder exists #2481

Merged
merged 1 commit into from Apr 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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