From 983705f3b0649c27e57bd4464eb358b423dc75a3 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Thu, 2 Jan 2025 18:08:09 -0800 Subject: [PATCH] fix: LuaSnip personal snippets working --- nvim/lua/plugins/coding/luasnip.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/nvim/lua/plugins/coding/luasnip.lua b/nvim/lua/plugins/coding/luasnip.lua index d001c15..4a81cf4 100644 --- a/nvim/lua/plugins/coding/luasnip.lua +++ b/nvim/lua/plugins/coding/luasnip.lua @@ -15,7 +15,16 @@ return { -- friendly-snippets require('luasnip.loaders.from_vscode').lazy_load() - -- Personal snippets - require('luasnip.loaders.from_lua').load({ path = 'lua/snippets' }) + -- Personal snippets. + local snippets = {} + + local paths = vim.api.nvim_get_runtime_file('lua/snippets', true) + for _, path in ipairs(paths) do + if string.find(path, '%/nix%/store%/.+') then + table.insert(snippets, path) + end + end + + require('luasnip.loaders.from_lua').load({ paths = snippets }) end, }