mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-20 10:35:08 +02:00
fix: correct runtimepath order (#4124)
This commit is contained in:
parent
55e7fdb9d1
commit
6d3f8b2183
2 changed files with 14 additions and 3 deletions
2
init.lua
2
init.lua
|
@ -5,7 +5,7 @@ local base_dir = vim.env.LUNARVIM_BASE_DIR
|
||||||
end)()
|
end)()
|
||||||
|
|
||||||
if not vim.tbl_contains(vim.opt.rtp:get(), base_dir) then
|
if not vim.tbl_contains(vim.opt.rtp:get(), base_dir) then
|
||||||
vim.opt.rtp:append(base_dir)
|
vim.opt.rtp:prepend(base_dir)
|
||||||
end
|
end
|
||||||
|
|
||||||
require("lvim.bootstrap"):init(base_dir)
|
require("lvim.bootstrap"):init(base_dir)
|
||||||
|
|
|
@ -42,8 +42,19 @@ function plugin_loader.init(opts)
|
||||||
vim.api.nvim_create_autocmd("User", { pattern = "LazyDone", callback = require("lvim.lsp").setup })
|
vim.api.nvim_create_autocmd("User", { pattern = "LazyDone", callback = require("lvim.lsp").setup })
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.opt.runtimepath:append(lazy_install_dir)
|
local rtp = vim.opt.rtp:get()
|
||||||
vim.opt.runtimepath:append(join_paths(plugins_dir, "*"))
|
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()
|
pcall(function()
|
||||||
-- set a custom path for lazy's cache
|
-- set a custom path for lazy's cache
|
||||||
|
|
Loading…
Reference in a new issue