LunarVim/lua/lvim/plugin-loader.lua

139 lines
4 KiB
Lua
Raw Normal View History

local plugin_loader = {}
local utils = require "lvim.utils"
local Log = require "lvim.core.log"
local join_paths = utils.join_paths
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
local plugins_dir = join_paths(get_runtime_dir(), "site", "pack", "lazy", "opt")
2021-09-16 09:58:32 +02:00
function plugin_loader.init(opts)
opts = opts or {}
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
local lazy_install_dir = opts.install_path
or join_paths(vim.fn.stdpath "data", "site", "pack", "lazy", "opt", "lazy.nvim")
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
if not utils.is_directory(lazy_install_dir) then
print "Initializing first time setup"
local core_plugins_dir = join_paths(get_lvim_base_dir(), "plugins")
if utils.is_directory(core_plugins_dir) then
vim.fn.mkdir(plugins_dir, "p")
vim.fn.delete(plugins_dir, "rf")
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
require("lvim.utils").fs_copy(core_plugins_dir, plugins_dir)
else
vim.fn.system {
"git",
"clone",
"--branch=stable",
"https://github.com/folke/lazy.nvim.git",
lazy_install_dir,
}
local default_snapshot_path = join_paths(get_lvim_base_dir(), "snapshots", "default.json")
local snapshot = assert(vim.fn.json_decode(vim.fn.readfile(default_snapshot_path)))
vim.fn.system {
"git",
"-C",
lazy_install_dir,
"checkout",
snapshot["lazy.nvim"].commit,
}
end
vim.api.nvim_create_autocmd("User", { pattern = "LazyDone", callback = require("lvim.lsp").setup })
end
2023-05-07 10:36:42 +02:00
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
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
pcall(function()
-- set a custom path for lazy's cache
local lazy_cache = require "lazy.core.cache"
lazy_cache.path = join_paths(get_cache_dir(), "lazy", "luac")
end)
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
end
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
function plugin_loader.reload(spec)
local Config = require "lazy.core.config"
local lazy = require "lazy"
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
-- TODO: reset cache? and unload plugins?
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
Config.spec = spec
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
require("lazy.core.plugin").load(true)
require("lazy.core.plugin").update_state()
2021-09-16 09:58:32 +02:00
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
local not_installed_plugins = vim.tbl_filter(function(plugin)
return not plugin._.installed
end, Config.plugins)
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
require("lazy.manage").clear()
2021-09-16 09:58:32 +02:00
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
if #not_installed_plugins > 0 then
lazy.install { wait = true }
end
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
if #Config.to_clean > 0 then
-- TODO: set show to true when lazy shows something useful on clean
lazy.clean { wait = true, show = false }
end
end
function plugin_loader.load(configurations)
Log:debug "loading plugins configuration"
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
local lazy_available, lazy = pcall(require, "lazy")
if not lazy_available then
Log:warn "skipping loading plugins until lazy.nvim is installed"
return
end
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
-- remove plugins from rtp before loading lazy, so that all plugins won't be loaded on startup
vim.opt.runtimepath:remove(join_paths(plugins_dir, "*"))
local status_ok = xpcall(function()
table.insert(lvim.lazy.opts.install.colorscheme, 1, lvim.colorscheme)
lazy.setup(configurations, lvim.lazy.opts)
end, debug.traceback)
if not status_ok then
Log:warn "problems detected while loading plugins' configurations"
Log:trace(debug.traceback())
end
end
function plugin_loader.get_core_plugins()
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
local names = {}
local plugins = require "lvim.plugins"
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
local get_name = require("lazy.core.plugin").Spec.get_name
for _, spec in pairs(plugins) do
if spec.enabled == true or spec.enabled == nil then
table.insert(names, get_name(spec[1]))
end
end
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
return names
end
function plugin_loader.sync_core_plugins()
local core_plugins = plugin_loader.get_core_plugins()
Log:trace(string.format("Syncing core plugins: [%q]", table.concat(core_plugins, ", ")))
require("lazy").update { wait = true, plugins = core_plugins }
end
function plugin_loader.ensure_plugins()
refactor: migrate to lazy.nvim (#3647) * refactor: convert plugins spec to lazy * refactor(lazy): remove impatient * fix(telescope): no more errors if theme is nil * refactor(lazy): use lazy in plugin_loader * refactor(lazy): pin plugins with packer's snapshot * fix: add plugins to rtp before config:init * fix: fs_stat nil check * feat: lazy cache * feat(lazy): reloading * refactor(lazy): plugin-loader functions * feat(lazy): cache reset * refactor: set runtimepath manually * fix: runtimepath * refactor(rtp) * refactor(lazy): packer -> lazy in various places * fix(lazy): disable tree-sitter ensure installed * refactor(lazy): restore order to bootstrap * refactor(lazy): remove unused impatient profiler * small fixes * `lvim.plugins` deprecation handling * fix: deprecation of `requires` in plugin specs * feat: core plugins pinning * refactor(lazy): plugin loader tests * refactor(lazy): use lazy in scripts * refactor(lazy): which-key keybinds * chore: format * fix: installer * fix: first time setup * feat: changes required for packaging commit 951ac2b7c01b5200b973660c967852d1706cce28 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:49:44 2022 +0100 fix: clean folder before copying plugins commit 64e9afa44b8e528ba527e0510d0d8c2d2237a095 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:35:41 2022 +0100 feat: copy core plugins on first run commit 2d8e72090c7624f68c09a9aa6582223373a810c1 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:11:22 2022 +0100 feat(utils): fs_copy commit 85c1f025a6ba13183e85141f75f60e2eefc77bb5 Author: LostNeophyte <lostneophyte@tuta.io> Date: Wed Dec 28 13:04:38 2022 +0100 fix: copy correct example config * fix: packer specs deprecation handling * fix: plugin specs deprecation * feat: pin lazy's version * fix: remove plugins form rtp before loading lazy * fix: plugin-loader test * feat(lazy): add keymappings for profile, log, and debug (#3665) * feat(lazy): Add keymappings for profile, log, and debug * feat(lazy): Add keymap for cleaning * chore: format * pref: lazy load many plugins Co-authored-by: Uzair Aftab <uzaaft@outlook.com> * fix: bootstrap correct version of lazy * fix: also use CmdLineEnter event for cmp * fix: don't use lazy's modules before it's set up * perf: (hack) enable lazy's cache before loading lazy * fix: plugins.lua * fix: plugins bump script * chore: remove debug print * feat: add rounded border for `:Lazy` * fix: bufferline flashing * fix: don't close lazy on startup * fix: load breadcrumbs on startup * fix: don't lazy load bufferline * chore: bump lazy's version * fix: remove site from rtp (fixes treesitter issues) * revert default config copying changes * fix(bootstrap): actually remove plugins dir on windows * chore: bump lazy's version * chore: bump lazy's version Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com> Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Co-authored-by: Uzair Aftab <uzaaft@outlook.com> Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
2023-01-10 21:18:17 +01:00
Log:debug "calling lazy.install()"
require("lazy").install { wait = true }
end
return plugin_loader