mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-18 00:08:21 +02:00
* 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>
314 lines
7.4 KiB
Lua
314 lines
7.4 KiB
Lua
-- local require = require("lvim.utils.require").require
|
|
local core_plugins = {
|
|
{ "folke/lazy.nvim", tag = "stable" },
|
|
{
|
|
"neovim/nvim-lspconfig",
|
|
lazy = true,
|
|
dependencies = { "mason-lspconfig.nvim", "nlsp-settings.nvim" },
|
|
},
|
|
{ "williamboman/mason-lspconfig.nvim", lazy = true },
|
|
{ "tamago324/nlsp-settings.nvim", lazy = true },
|
|
{ "jose-elias-alvarez/null-ls.nvim", lazy = true },
|
|
{
|
|
"williamboman/mason.nvim",
|
|
config = function()
|
|
require("lvim.core.mason").setup()
|
|
end,
|
|
},
|
|
{
|
|
"folke/tokyonight.nvim",
|
|
},
|
|
{
|
|
"lunarvim/lunar.nvim",
|
|
},
|
|
{ "Tastyep/structlog.nvim" },
|
|
|
|
{ "nvim-lua/popup.nvim" },
|
|
{ "nvim-lua/plenary.nvim" },
|
|
-- Telescope
|
|
{
|
|
"nvim-telescope/telescope.nvim",
|
|
branch = "0.1.x",
|
|
config = function()
|
|
require("lvim.core.telescope").setup()
|
|
end,
|
|
dependencies = { "telescope-fzf-native.nvim" },
|
|
lazy = true,
|
|
cmd = "Telescope",
|
|
enabled = lvim.builtin.telescope.active,
|
|
},
|
|
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make", lazy = true, enabled = lvim.builtin.telescope.active },
|
|
-- Install nvim-cmp, and buffer source as a dependency
|
|
{
|
|
"hrsh7th/nvim-cmp",
|
|
config = function()
|
|
if lvim.builtin.cmp then
|
|
require("lvim.core.cmp").setup()
|
|
end
|
|
end,
|
|
event = { "InsertEnter", "CmdlineEnter" },
|
|
dependencies = {
|
|
"cmp-nvim-lsp",
|
|
"cmp_luasnip",
|
|
"cmp-buffer",
|
|
"cmp-path",
|
|
},
|
|
},
|
|
{ "hrsh7th/cmp-nvim-lsp", lazy = true },
|
|
{ "saadparwaiz1/cmp_luasnip", lazy = true },
|
|
{ "hrsh7th/cmp-buffer", lazy = true },
|
|
{ "hrsh7th/cmp-path", lazy = true },
|
|
{
|
|
"L3MON4D3/LuaSnip",
|
|
config = function()
|
|
local utils = require "lvim.utils"
|
|
local paths = {}
|
|
if lvim.builtin.luasnip.sources.friendly_snippets then
|
|
paths[#paths + 1] = utils.join_paths(get_runtime_dir(), "site", "pack", "lazy", "opt", "friendly-snippets")
|
|
end
|
|
local user_snippets = utils.join_paths(get_config_dir(), "snippets")
|
|
if utils.is_directory(user_snippets) then
|
|
paths[#paths + 1] = user_snippets
|
|
end
|
|
require("luasnip.loaders.from_lua").lazy_load()
|
|
require("luasnip.loaders.from_vscode").lazy_load {
|
|
paths = paths,
|
|
}
|
|
require("luasnip.loaders.from_snipmate").lazy_load()
|
|
end,
|
|
event = "InsertEnter",
|
|
dependencies = {
|
|
"friendly-snippets",
|
|
},
|
|
},
|
|
{ "rafamadriz/friendly-snippets", lazy = true, cond = lvim.builtin.luasnip.sources.friendly_snippets },
|
|
{
|
|
"folke/neodev.nvim",
|
|
lazy = true,
|
|
},
|
|
|
|
-- Autopairs
|
|
{
|
|
"windwp/nvim-autopairs",
|
|
event = "InsertEnter",
|
|
config = function()
|
|
require("lvim.core.autopairs").setup()
|
|
end,
|
|
enabled = lvim.builtin.autopairs.active,
|
|
},
|
|
|
|
-- Treesitter
|
|
{
|
|
"nvim-treesitter/nvim-treesitter",
|
|
-- run = ":TSUpdate",
|
|
config = function()
|
|
require("lvim.core.treesitter").setup()
|
|
end,
|
|
},
|
|
{
|
|
"JoosepAlviste/nvim-ts-context-commentstring",
|
|
event = "VeryLazy",
|
|
},
|
|
|
|
-- NvimTree
|
|
{
|
|
"kyazdani42/nvim-tree.lua",
|
|
-- event = "BufWinOpen",
|
|
-- cmd = "NvimTreeToggle",
|
|
config = function()
|
|
require("lvim.core.nvimtree").setup()
|
|
end,
|
|
enabled = lvim.builtin.nvimtree.active,
|
|
},
|
|
-- Lir
|
|
{
|
|
"LunarVim/lir.nvim",
|
|
config = function()
|
|
require("lvim.core.lir").setup()
|
|
end,
|
|
enabled = lvim.builtin.lir.active,
|
|
},
|
|
{
|
|
"lewis6991/gitsigns.nvim",
|
|
config = function()
|
|
require("lvim.core.gitsigns").setup()
|
|
end,
|
|
event = "BufRead",
|
|
enabled = lvim.builtin.gitsigns.active,
|
|
},
|
|
|
|
-- Whichkey
|
|
{
|
|
"folke/which-key.nvim",
|
|
config = function()
|
|
require("lvim.core.which-key").setup()
|
|
end,
|
|
event = "VeryLazy",
|
|
enabled = lvim.builtin.which_key.active,
|
|
},
|
|
|
|
-- Comments
|
|
{
|
|
"numToStr/Comment.nvim",
|
|
event = "BufRead",
|
|
config = function()
|
|
require("lvim.core.comment").setup()
|
|
end,
|
|
enabled = lvim.builtin.comment.active,
|
|
},
|
|
|
|
-- project.nvim
|
|
{
|
|
"ahmedkhalf/project.nvim",
|
|
config = function()
|
|
require("lvim.core.project").setup()
|
|
end,
|
|
enabled = lvim.builtin.project.active,
|
|
},
|
|
|
|
-- Icons
|
|
{
|
|
"kyazdani42/nvim-web-devicons",
|
|
enabled = lvim.use_icons,
|
|
},
|
|
|
|
-- Status Line and Bufferline
|
|
{
|
|
-- "hoob3rt/lualine.nvim",
|
|
"nvim-lualine/lualine.nvim",
|
|
-- "Lunarvim/lualine.nvim",
|
|
config = function()
|
|
require("lvim.core.lualine").setup()
|
|
end,
|
|
enabled = lvim.builtin.lualine.active,
|
|
},
|
|
|
|
-- breadcrumbs
|
|
{
|
|
"SmiteshP/nvim-navic",
|
|
config = function()
|
|
require("lvim.core.breadcrumbs").setup()
|
|
end,
|
|
enabled = lvim.builtin.breadcrumbs.active,
|
|
},
|
|
|
|
{
|
|
"akinsho/bufferline.nvim",
|
|
config = function()
|
|
require("lvim.core.bufferline").setup()
|
|
end,
|
|
branch = "main",
|
|
enabled = lvim.builtin.bufferline.active,
|
|
},
|
|
|
|
-- Debugging
|
|
{
|
|
"mfussenegger/nvim-dap",
|
|
-- event = "BufWinEnter",
|
|
config = function()
|
|
require("lvim.core.dap").setup()
|
|
end,
|
|
enabled = lvim.builtin.dap.active,
|
|
},
|
|
|
|
-- Debugger user interface
|
|
{
|
|
"rcarriga/nvim-dap-ui",
|
|
config = function()
|
|
require("lvim.core.dap").setup_ui()
|
|
end,
|
|
enabled = lvim.builtin.dap.active,
|
|
},
|
|
|
|
-- alpha
|
|
{
|
|
"goolord/alpha-nvim",
|
|
config = function()
|
|
require("lvim.core.alpha").setup()
|
|
end,
|
|
enabled = lvim.builtin.alpha.active,
|
|
},
|
|
|
|
-- Terminal
|
|
{
|
|
"akinsho/toggleterm.nvim",
|
|
event = "VeryLazy",
|
|
branch = "main",
|
|
config = function()
|
|
require("lvim.core.terminal").setup()
|
|
end,
|
|
enabled = lvim.builtin.terminal.active,
|
|
},
|
|
|
|
-- SchemaStore
|
|
{
|
|
"b0o/schemastore.nvim",
|
|
lazy = true,
|
|
},
|
|
|
|
{
|
|
"RRethy/vim-illuminate",
|
|
config = function()
|
|
require("lvim.core.illuminate").setup()
|
|
end,
|
|
event = "VeryLazy",
|
|
enabled = lvim.builtin.illuminate.active,
|
|
},
|
|
|
|
{
|
|
"lukas-reineke/indent-blankline.nvim",
|
|
config = function()
|
|
require("lvim.core.indentlines").setup()
|
|
end,
|
|
enabled = lvim.builtin.indentlines.active,
|
|
},
|
|
|
|
{
|
|
"lunarvim/onedarker.nvim",
|
|
branch = "freeze",
|
|
config = function()
|
|
pcall(function()
|
|
if lvim and lvim.colorscheme == "onedarker" then
|
|
require("onedarker").setup()
|
|
lvim.builtin.lualine.options.theme = "onedarker"
|
|
end
|
|
end)
|
|
end,
|
|
enabled = lvim.colorscheme == "onedarker",
|
|
},
|
|
|
|
{
|
|
"lunarvim/bigfile.nvim",
|
|
config = function()
|
|
pcall(function()
|
|
require("bigfile").config(lvim.builtin.bigfile.config)
|
|
end)
|
|
end,
|
|
enabled = lvim.builtin.bigfile.active,
|
|
},
|
|
}
|
|
|
|
local default_snapshot_path = join_paths(get_lvim_base_dir(), "snapshots", "default.json")
|
|
local content = vim.fn.readfile(default_snapshot_path)
|
|
local default_sha1 = assert(vim.fn.json_decode(content))
|
|
|
|
-- taken form <https://github.com/folke/lazy.nvim/blob/c7122d64cdf16766433588486adcee67571de6d0/lua/lazy/core/plugin.lua#L27>
|
|
local get_short_name = function(long_name)
|
|
local name = long_name:sub(-4) == ".git" and long_name:sub(1, -5) or long_name
|
|
local slash = name:reverse():find("/", 1, true) --[[@as number?]]
|
|
return slash and name:sub(#name - slash + 2) or long_name:gsub("%W+", "_")
|
|
end
|
|
|
|
local get_default_sha1 = function(spec)
|
|
local short_name = get_short_name(spec[1])
|
|
return default_sha1[short_name] and default_sha1[short_name].commit
|
|
end
|
|
|
|
if not vim.env.LVIM_DEV_MODE then
|
|
-- Manually lock the commit hashes of core plugins
|
|
for _, spec in ipairs(core_plugins) do
|
|
spec["commit"] = get_default_sha1(spec)
|
|
end
|
|
end
|
|
|
|
return core_plugins
|