forked from Archives/navigator.lua
d771df0fa7
On a clean install, packer compiles down to: ```lua ["nvim-lspinstall"] = { loaded = true, path = "..." }, ``` rather than ```lua ["nvim-lspinstall"] = { loaded = true, path = "..." }, ``` without this change, I get a (cosmetic) error on every startup like this: ``` Error: attempted to load lspinstall which is not present in plugins table! Error in packer_compiled: ...m/site/pack/packer/start/packer.nvim/lua/packer/load.lua:13: Error: attempted to load lspinstall which is not present in plugins table! Please check your config for correctness ``` ```
32 lines
847 B
Lua
32 lines
847 B
Lua
local log = require"navigator.util".log
|
|
_LoadedClients = {}
|
|
local loader = nil
|
|
packer_plugins = packer_plugins or nil -- suppress warnings
|
|
|
|
-- packer only
|
|
if packer_plugins ~= nil then -- packer install
|
|
local lazy_plugins = {
|
|
["nvim-lspconfig"] = "neovim/nvim-lspconfig",
|
|
["guihua.lua"] = "ray-x/guihua.lua"
|
|
}
|
|
if _NgConfigValues.lspinstall == true then
|
|
lazy_plugins["nvim-lspinstall"] = "kabouzeid/nvim-lspinstall"
|
|
end
|
|
|
|
-- packer installed
|
|
loader = require"packer".loader
|
|
for plugin, url in pairs(lazy_plugins) do
|
|
if not packer_plugins[url] or not packer_plugins[url].loaded then
|
|
log("loading ", plugin)
|
|
loader(plugin)
|
|
end
|
|
end
|
|
|
|
if _NgConfigValues.lspinstall == true then
|
|
local has_lspinst, lspinst = pcall(require, "lspinstall")
|
|
if has_lspinst then
|
|
lspinst.setup()
|
|
end
|
|
end
|
|
end
|