Merged from template master

This commit is contained in:
2024-01-28 11:35:10 +01:00
parent a55e972ecb
commit 360a40d01a
2 changed files with 39 additions and 16 deletions

View File

@@ -1,5 +1,5 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.env.LAZY or vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then if not (vim.env.LAZY or vim.loop.fs_stat(lazypath)) then
vim.g.astronvim_first_install = true -- lets AstroNvim know that this is an initial installation vim.g.astronvim_first_install = true -- lets AstroNvim know that this is an initial installation
vim.fn.system { vim.fn.system {
"git", "git",
@@ -10,23 +10,25 @@ if not vim.loop.fs_stat(lazypath) then
lazypath, lazypath,
} }
end end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath) vim.opt.rtp:prepend(lazypath)
-- TODO: set to true on release
-- Whether or not to use stable releases of AstroNvim
local USE_STABLE = false
require("lazy").setup { local lazy_loaded, lazy = pcall(require, "lazy") -- validate that lazy is available
dev = { if not lazy_loaded then
path = "~/Workspace", -- stylua: ignore
patterns = {}, vim.api.nvim_echo({ { ("Unable to load lazy from: %s\n"):format(lazypath), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {})
fallback = true, -- Fallback to git when local plugin doesn't exist vim.fn.getchar()
}, vim.cmd.quit()
end
lazy.setup({
spec = { spec = {
-- TODO: remove branch v4 on release -- TODO: remove branch v4 on release
{ "AstroNvim/AstroNvim", branch = "v4", version = USE_STABLE and "^4" or nil, import = "astronvim.plugins" }, {
-- pin plugins to known working versions "AstroNvim/AstroNvim",
{ import = "astronvim.lazy_snapshot", cond = USE_STABLE }, branch = "v4",
import = "astronvim.plugins",
},
{ import = "plugins" }, { import = "plugins" },
}, },
install = { colorscheme = { "astrodark", "habamax" } }, install = { colorscheme = { "astrodark", "habamax" } },
@@ -42,4 +44,9 @@ require("lazy").setup {
}, },
}, },
}, },
} dev = {
path = "~/Workspace",
patterns = {},
fallback = true, -- Fallback to git when local plugin doesn't exist
},
} --[[@as LazyConfig]])

View File

@@ -0,0 +1,16 @@
-- This file is automatically ran last in the setup process and is a good place to configure
-- augroups/autocommands and custom filetypes also this just pure lua so
-- anything that doesn't fit in the normal config locations above can go here
-- Set up custom filetypes
-- vim.filetype.add {
-- extension = {
-- foo = "fooscript",
-- },
-- filename = {
-- ["Foofile"] = "fooscript",
-- },
-- pattern = {
-- ["~/%.config/foo/.*"] = "fooscript",
-- },
-- }