|
@@ -42,8 +42,19 @@ function plugin_loader.init(opts)
|
|
|
vim.api.nvim_create_autocmd("User", { pattern = "LazyDone", callback = require("lvim.lsp").setup })
|
|
|
end
|
|
|
|
|
|
- vim.opt.runtimepath:append(lazy_install_dir)
|
|
|
- vim.opt.runtimepath:append(join_paths(plugins_dir, "*"))
|
|
|
+ local rtp = vim.opt.rtp:get()
|
|
|
+ local base_dir = (vim.env.LUNARVIM_BASE_DIR or get_runtime_dir() .. "/lvim"):gsub("\\", "/")
|
|
|
+ local idx_base = #rtp + 1
|
|
|
+ for i, path in ipairs(rtp) do
|
|
|
+ path = path:gsub("\\", "/")
|
|
|
+ if path == base_dir then
|
|
|
+ idx_base = i + 1
|
|
|
+ break
|
|
|
+ end
|
|
|
+ end
|
|
|
+ table.insert(rtp, idx_base, lazy_install_dir)
|
|
|
+ table.insert(rtp, idx_base + 1, join_paths(plugins_dir, "*"))
|
|
|
+ vim.opt.rtp = rtp
|
|
|
|
|
|
pcall(function()
|
|
|
-- set a custom path for lazy's cache
|