refactor: move `lazy` setup so user never touches `init.lua`
parent
75d2b26b6e
commit
f4b42001e2
35
init.lua
35
init.lua
|
@ -6,42 +6,13 @@ if not (vim.env.LAZY or vim.loop.fs_stat(lazypath)) then
|
|||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local lazy_loaded, lazy = pcall(require, "lazy") -- validate that lazy is available
|
||||
if not lazy_loaded then
|
||||
-- validate that lazy is available
|
||||
if not pcall(require, "lazy") then
|
||||
-- stylua: ignore
|
||||
vim.api.nvim_echo({ { ("Unable to load lazy from: %s\n"):format(lazypath), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {})
|
||||
vim.fn.getchar()
|
||||
vim.cmd.quit()
|
||||
end
|
||||
|
||||
lazy.setup({
|
||||
{
|
||||
"AstroNvim/AstroNvim",
|
||||
branch = "v4", -- TODO: change `branch="v4"` to `version="^4"` on release
|
||||
import = "astronvim.plugins",
|
||||
opts = { -- AstroNvim options must be set with the `import` key
|
||||
mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up
|
||||
maplocalleader = ",", -- This ensures the localleader key must be configured before Lazy is set up
|
||||
icons_enabled = true, -- Set to false to disable icons (if no Nerd Font is available)
|
||||
pin_plugins = nil, -- Default will pin plugins when tracking `version` of AstroNvim, set to true/false to override
|
||||
},
|
||||
},
|
||||
{ import = "community" },
|
||||
{ import = "plugins" },
|
||||
} --[[@as LazySpec]], {
|
||||
install = { colorscheme = { "astrodark", "habamax" } },
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins, add more to your liking
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
"netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
} --[[@as LazyConfig]])
|
||||
|
||||
require "lazy_setup"
|
||||
require "polish"
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
require("lazy").setup({
|
||||
{
|
||||
"AstroNvim/AstroNvim",
|
||||
branch = "v4", -- TODO: change `branch="v4"` to `version="^4"` on release
|
||||
import = "astronvim.plugins",
|
||||
opts = { -- AstroNvim options must be set here with the `import` key
|
||||
mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up
|
||||
maplocalleader = ",", -- This ensures the localleader key must be configured before Lazy is set up
|
||||
icons_enabled = true, -- Set to false to disable icons (if no Nerd Font is available)
|
||||
pin_plugins = nil, -- Default will pin plugins when tracking `version` of AstroNvim, set to true/false to override
|
||||
},
|
||||
},
|
||||
{ import = "community" },
|
||||
{ import = "plugins" },
|
||||
} --[[@as LazySpec]], {
|
||||
install = { colorscheme = { "astrodark", "habamax" } },
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins, add more to your liking
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
"netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
} --[[@as LazyConfig]])
|
Loading…
Reference in New Issue