diff --git a/init.lua b/init.lua index fe3576b..51c4aaa 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,28 @@ --- bootstrap lazy.nvim, AstroNvim, and user plugins -require("config.lazy") --- run polish file at the very end -pcall(require, "config.polish") +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 + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +if not pcall(require, "lazy") then + 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 + +require("lazy_setup") diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua deleted file mode 100644 index 83fe90d..0000000 --- a/lua/config/lazy.lua +++ /dev/null @@ -1,51 +0,0 @@ -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", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - -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", - import = "astronvim.plugins", - }, - { import = "plugins" }, - }, - install = { colorscheme = { "astrodark", "habamax" } }, - performance = { - rtp = { - -- disable some rtp plugins, add more to your liking - disabled_plugins = { - "gzip", - "netrwPlugin", - "tarPlugin", - "tohtml", - "zipPlugin", - }, - }, - }, - dev = { - path = "~/Workspace", - patterns = {}, - fallback = true, -- Fallback to git when local plugin doesn't exist - }, -} --[[@as LazyConfig]]) diff --git a/lua/config/options.lua b/lua/config/options.lua deleted file mode 100644 index 8e20aa5..0000000 --- a/lua/config/options.lua +++ /dev/null @@ -1,22 +0,0 @@ -vim.opt.background = "dark" -vim.opt.clipboard = "" -vim.opt.cmdheight = 1 -vim.opt.expandtab = true -vim.opt.foldmethod = "syntax" -vim.opt.foldnestmax = 150 -vim.opt.grepprg = vim.fn.executable("rg") and "rg --vimgrep" or nil -vim.opt.guifont = { "VictorMono Nerd Font", "Hack Nerd Font Mono", ":h10" } -vim.opt.listchars = { tab = "> ", extends = ">", precedes = "<", space = "·" } -vim.opt.number = true -vim.opt.relativenumber = false -vim.opt.shiftwidth = 4 -vim.opt.signcolumn = "auto" -vim.opt.spell = false -vim.opt.tabstop = 4 -vim.opt.textwidth = 120 -vim.opt.wrap = true - -vim.opt.path:append("**") -- recursive search for find - --- Globals -vim.g.rust_recommended_style = 0 diff --git a/lua/config/polish.lua b/lua/config/polish.lua deleted file mode 100644 index 123798f..0000000 --- a/lua/config/polish.lua +++ /dev/null @@ -1,16 +0,0 @@ --- 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", --- }, --- } diff --git a/lua/lazy_setup.lua b/lua/lazy_setup.lua new file mode 100644 index 0000000..cbfd74c --- /dev/null +++ b/lua/lazy_setup.lua @@ -0,0 +1,29 @@ +require("lazy").setup{ + spec = { + -- TODO: remove branch v4 on release + { + "AstroNvim/AstroNvim", + branch = "v4", + import = "astronvim.plugins", + }, + { import = "plugins" }, + }, + install = { colorscheme = { "astrodark", "habamax" } }, + performance = { + rtp = { + -- disable some rtp plugins, add more to your liking + disabled_plugins = { + "gzip", + "netrwPlugin", + "tarPlugin", + "tohtml", + "zipPlugin", + }, + }, + }, + dev = { + path = "~/Workspace", + patterns = {}, + fallback = true, -- Fallback to git when local plugin doesn't exist + }, +} --[[@as LazyConfig]] diff --git a/lua/plugins/14-options.lua b/lua/plugins/14-options.lua new file mode 100644 index 0000000..8a90520 --- /dev/null +++ b/lua/plugins/14-options.lua @@ -0,0 +1,32 @@ +---@type LazySpec +return { + "AstroNvim/astrocore", + ---@type AstroCoreOpts + opts = { + options = { + opt = { + background = "dark", + clipboard = "", + cmdheight = 1, + expandtab = true, + foldmethod = "syntax", + foldnestmax = 150, + grepprg = vim.fn.executable("rg") and "rg --vimgrep" or nil, + guifont = { "VictorMono Nerd Font", "Hack Nerd Font Mono", ":h10" }, + listchars = { tab = "> ", extends = ">", precedes = "<", space = "·" }, + number = true, + relativenumber = false, + shiftwidth = 4, + signcolumn = "auto", + spell = false, + tabstop = 4, + textwidth = 120, + wrap = true, + path = vim.list_extend(vim.opt.path:get(), { "**" }), + }, + g = { + rust_recommended_style = 0, + }, + }, + }, +} diff --git a/lua/plugins/50-user.lua b/lua/plugins/50-user.lua index e716234..6f85ca4 100644 --- a/lua/plugins/50-user.lua +++ b/lua/plugins/50-user.lua @@ -2,4 +2,5 @@ return { { "echasnovski/mini.align", event = "User AstroFile", config = function() require("mini.align").setup({}) end }, { "tpope/vim-abolish", event = "User AstroFile" }, + { "rcarriga/nvim-notify", dev = true }, -- Until upstream fix for v10 }