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
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
local lazy_loaded, lazy = pcall(require, "lazy") -- validate that lazy is available
|
-- validate that lazy is available
|
||||||
if not lazy_loaded then
|
if not pcall(require, "lazy") then
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
vim.api.nvim_echo({ { ("Unable to load lazy from: %s\n"):format(lazypath), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {})
|
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.fn.getchar()
|
||||||
vim.cmd.quit()
|
vim.cmd.quit()
|
||||||
end
|
end
|
||||||
|
|
||||||
lazy.setup({
|
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 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 "polish"
|
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