| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 | local reload = require("lvim.utils.reload").reloadlocal core_plugins = {  -- Packer can manage itself as an optional plugin  { "wbthomason/packer.nvim" },  { "neovim/nvim-lspconfig" },  { "tamago324/nlsp-settings.nvim" },  {    "jose-elias-alvarez/null-ls.nvim",  },  { "williamboman/mason-lspconfig.nvim" },  {    "williamboman/mason.nvim",    config = function()      reload("lvim.core.mason").setup()    end,  },  {    "folke/tokyonight.nvim",    config = function()      reload("lvim.core.theme").setup()    end,    -- disable = not vim.startswith(lvim.colorscheme, "tokyonight"),  },  {    "rcarriga/nvim-notify",    config = function()      reload("lvim.core.notify").setup()    end,    requires = { "nvim-telescope/telescope.nvim" },    disable = not lvim.builtin.notify.active or not lvim.builtin.telescope.active,  },  { "Tastyep/structlog.nvim" },  { "nvim-lua/popup.nvim" },  { "nvim-lua/plenary.nvim" },  -- Telescope  {    "nvim-telescope/telescope.nvim",    branch = "0.1.x",    config = function()      reload("lvim.core.telescope").setup()    end,    disable = not lvim.builtin.telescope.active,  },  {    "nvim-telescope/telescope-fzf-native.nvim",    requires = { "nvim-telescope/telescope.nvim" },    run = "make",    disable = not lvim.builtin.telescope.active,  },  -- Install nvim-cmp, and buffer source as a dependency  {    "hrsh7th/nvim-cmp",    config = function()      if lvim.builtin.cmp then        reload("lvim.core.cmp").setup()      end    end,    requires = {      "L3MON4D3/LuaSnip",    },  },  {    "rafamadriz/friendly-snippets",    disable = not lvim.builtin.luasnip.sources.friendly_snippets,  },  {    "L3MON4D3/LuaSnip",    config = function()      local utils = reload "lvim.utils"      local paths = {}      if lvim.builtin.luasnip.sources.friendly_snippets then        paths[#paths + 1] = utils.join_paths(get_runtime_dir(), "site", "pack", "packer", "start", "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      reload("luasnip.loaders.from_lua").lazy_load()      reload("luasnip.loaders.from_vscode").lazy_load {        paths = paths,      }      reload("luasnip.loaders.from_snipmate").lazy_load()    end,  },  {    "hrsh7th/cmp-nvim-lsp",  },  {    "saadparwaiz1/cmp_luasnip",  },  {    "hrsh7th/cmp-buffer",  },  {    "hrsh7th/cmp-path",  },  {    "folke/lua-dev.nvim",    module = "lua-dev",  },  -- Autopairs  {    "windwp/nvim-autopairs",    -- event = "InsertEnter",    config = function()      reload("lvim.core.autopairs").setup()    end,    disable = not lvim.builtin.autopairs.active,  },  -- Treesitter  {    "nvim-treesitter/nvim-treesitter",    -- run = ":TSUpdate",    config = function()      reload("lvim.core.treesitter").setup()    end,  },  {    "JoosepAlviste/nvim-ts-context-commentstring",    event = "BufReadPost",  },  -- NvimTree  {    "kyazdani42/nvim-tree.lua",    -- event = "BufWinOpen",    -- cmd = "NvimTreeToggle",    config = function()      reload("lvim.core.nvimtree").setup()    end,    disable = not lvim.builtin.nvimtree.active,  },  -- Lir  {    "christianchiarulli/lir.nvim",    config = function()      reload("lvim.core.lir").setup()    end,    disable = not lvim.builtin.lir.active,  },  {    "lewis6991/gitsigns.nvim",    config = function()      reload("lvim.core.gitsigns").setup()    end,    event = "BufRead",    disable = not lvim.builtin.gitsigns.active,  },  -- Whichkey  {    "folke/which-key.nvim",    config = function()      reload("lvim.core.which-key").setup()    end,    event = "BufWinEnter",    disable = not lvim.builtin.which_key.active,  },  -- Comments  {    "numToStr/Comment.nvim",    event = "BufRead",    config = function()      reload("lvim.core.comment").setup()    end,    disable = not lvim.builtin.comment.active,  },  -- project.nvim  {    "ahmedkhalf/project.nvim",    config = function()      reload("lvim.core.project").setup()    end,    disable = not lvim.builtin.project.active,  },  -- Icons  {    "kyazdani42/nvim-web-devicons",    disable = not lvim.use_icons,  },  -- Status Line and Bufferline  {    -- "hoob3rt/lualine.nvim",    "nvim-lualine/lualine.nvim",    -- "Lunarvim/lualine.nvim",    config = function()      reload("lvim.core.lualine").setup()    end,    disable = not lvim.builtin.lualine.active,  },  -- breadcrumbs  {    "SmiteshP/nvim-navic",    config = function()      reload("lvim.core.breadcrumbs").setup()    end,    disable = not lvim.builtin.breadcrumbs.active,  },  {    "akinsho/bufferline.nvim",    config = function()      reload("lvim.core.bufferline").setup()    end,    branch = "main",    event = "BufWinEnter",    disable = not lvim.builtin.bufferline.active,  },  -- Debugging  {    "mfussenegger/nvim-dap",    -- event = "BufWinEnter",    config = function()      reload("lvim.core.dap").setup()    end,    disable = not lvim.builtin.dap.active,  },  -- Debugger management  {    "Pocco81/dap-buddy.nvim",    branch = "dev",    -- event = "BufWinEnter",    -- event = "BufRead",    disable = not lvim.builtin.dap.active,  },  -- alpha  {    "goolord/alpha-nvim",    config = function()      reload("lvim.core.alpha").setup()    end,    disable = not lvim.builtin.alpha.active,  },  -- Terminal  {    "akinsho/toggleterm.nvim",    event = "BufWinEnter",    branch = "main",    config = function()      reload("lvim.core.terminal").setup()    end,    disable = not lvim.builtin.terminal.active,  },  -- SchemaStore  {    "b0o/schemastore.nvim",  },  {    "RRethy/vim-illuminate",    config = function()      reload("lvim.core.illuminate").setup()    end,    disable = not lvim.builtin.illuminate.active,  },  {    "lukas-reineke/indent-blankline.nvim",    config = function()      reload("lvim.core.indentlines").setup()    end,    disable = not lvim.builtin.indentlines.active,  },  {    "lunarvim/onedarker.nvim",    branch = "freeze",    config = function()      pcall(function()        if lvim and lvim.colorscheme == "onedarker" then          reload("onedarker").setup()          lvim.builtin.lualine.options.theme = "onedarker"        end      end)    end,    disable = lvim.colorscheme ~= "onedarker",  },}local default_snapshot_path = join_paths(get_lvim_base_dir(), "snapshots", "default.json")local content = vim.fn.readfile(default_snapshot_path)local default_sha1 = vim.fn.json_decode(content)local get_default_sha1 = function(spec)  local short_name, _ = reload("packer.util").get_plugin_short_name(spec)  return default_sha1[short_name] and default_sha1[short_name].commitendfor _, spec in ipairs(core_plugins) do  if not vim.env.LVIM_DEV_MODE then    -- Manually lock the commit hash since Packer's snapshots are unreliable in headless mode    spec["commit"] = get_default_sha1(spec)  endendreturn core_plugins
 |