From 360a40d01aa7aa9e44f2d958f7b94fe78fad4889 Mon Sep 17 00:00:00 2001 From: Niverton Date: Sun, 28 Jan 2024 11:35:10 +0100 Subject: [PATCH] Merged from template master --- lua/config/lazy.lua | 39 +++++++++++++++++++++++---------------- lua/config/polish.lua | 16 ++++++++++++++++ 2 files changed, 39 insertions(+), 16 deletions(-) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 61d234a..31ee5bf 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -1,5 +1,5 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then +local lazypath = vim.env.LAZY or vim.fn.stdpath "data" .. "/lazy/lazy.nvim" +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.fn.system { "git", @@ -10,23 +10,25 @@ if not vim.loop.fs_stat(lazypath) then lazypath, } 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 { - dev = { - path = "~/Workspace", - patterns = {}, - fallback = true, -- Fallback to git when local plugin doesn't exist - }, +local lazy_loaded, lazy = pcall(require, "lazy") -- validate that lazy is available +if not lazy_loaded 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({ spec = { -- 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 - { import = "astronvim.lazy_snapshot", cond = USE_STABLE }, + { + "AstroNvim/AstroNvim", + branch = "v4", + import = "astronvim.plugins", + }, { import = "plugins" }, }, 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]]) diff --git a/lua/config/polish.lua b/lua/config/polish.lua index e69de29..123798f 100644 --- a/lua/config/polish.lua +++ b/lua/config/polish.lua @@ -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", +-- }, +-- }