-
Hi there, I have treesitter managed by my nix package manager, but I'd like to have a bunch of plugins that depend on treesitter to be loaded by lazy, for example:
Normally it would be included in my runtimepath, and with packer I could just assume it would be injected before packer-managed plugins are loaded. With lazy, it seems the lazy-managed plugins are loaded first and I get a bunch of errors and missing nvim-treesitter namespaces. Is there a way to tell lazy to load my OS-managed treesitter before the lazy loaded plugins? Preferably by avoiding nuking it? (Perhaps there's a hook to let me write more selective rtp reset code?) I tried: require("lazy").setup("plugins", {
performance = {
reset_packpath = false,
rtp = { reset = false }
},
}) which fixes treesitter not being available but removes a lot of the speed benefits. I assume the way forward is to add the path to Is there any other way to do this that I'm not thinking of? My full config is here: shazow/nixfiles#10 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hello @shazow, Lazy.nvim has a
{
"nvim-treesitter/nvim-treesitter",
dir = vim.env.YOUR_NIX_LOCATION .. "/nvim-treesitter",
} Now, lazy.nvim only manages the loading of the plugin, and assumes its present at the location specified. Best regards! |
Beta Was this translation helpful? Give feedback.
Hello @shazow,
Lazy.nvim has a
dir
property.Using an environment variable pointing to the path managed by the nix package manager, this should work:
lua/plugins/your_treesitter.lua
:Now, lazy.nvim only manages the loading of the plugin, and assumes its present at the location specified.
Best regards!