From a1581f1182fc592ab00a38347dffe545d1d601c3 Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Wed, 26 Mar 2025 14:57:20 -0400 Subject: [PATCH] AstroNvim v5 (#29) * fix(astrocore): update to the new `diagnostics` settings style * fix(mason): move to installing Mason packages with `mason-tool-installer.nvim` * fix(user): update dashboard header example to use `snacks.dashboard` * fix(lazy_setup): bump version to v5 for release --- lua/lazy_setup.lua | 2 +- lua/plugins/astrocore.lua | 2 +- lua/plugins/mason.lua | 53 ++++++++++++++------------------------- lua/plugins/user.lua | 43 +++++++++++++++++-------------- 4 files changed, 45 insertions(+), 55 deletions(-) diff --git a/lua/lazy_setup.lua b/lua/lazy_setup.lua index cca2306..f867121 100644 --- a/lua/lazy_setup.lua +++ b/lua/lazy_setup.lua @@ -1,7 +1,7 @@ require("lazy").setup({ { "AstroNvim/AstroNvim", - version = "^4", -- Remove version tracking to elect for nighly AstroNvim + version = "^5", -- Remove version tracking to elect for nightly AstroNvim 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 diff --git a/lua/plugins/astrocore.lua b/lua/plugins/astrocore.lua index 69517d6..2d1f5ed 100644 --- a/lua/plugins/astrocore.lua +++ b/lua/plugins/astrocore.lua @@ -13,7 +13,7 @@ return { large_buf = { size = 1024 * 500, lines = 10000 }, -- set global limits for large files for disabling features like treesitter autopairs = false, -- enable autopairs at start cmp = true, -- enable completion at start - diagnostics_mode = 3, -- diagnostic mode on start (0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on) + diagnostics = { virtual_text = true, virtual_lines = false }, -- diagnostic settings on startup highlighturl = true, -- highlight URLs at start notifications = true, -- enable notifications at start }, diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index 634840f..2d79b5f 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -1,43 +1,28 @@ if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE --- Customize Mason plugins +-- Customize Mason ---@type LazySpec return { - -- use mason-lspconfig to configure LSP installations + -- use mason-tool-installer for automatically installing Mason packages { - "williamboman/mason-lspconfig.nvim", - -- overrides `require("mason-lspconfig").setup(...)` - opts = function(_, opts) - -- add more things to the ensure_installed table protecting against community packs modifying it - opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { - "lua_ls", - -- add more arguments for adding more language servers - }) - end, - }, - -- use mason-null-ls to configure Formatters/Linter installation for null-ls sources - { - "jay-babu/mason-null-ls.nvim", - -- overrides `require("mason-null-ls").setup(...)` - opts = function(_, opts) - -- add more things to the ensure_installed table protecting against community packs modifying it - opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { - "prettier", + "WhoIsSethDaniel/mason-tool-installer.nvim", + -- overrides `require("mason-tool-installer").setup(...)` + opts = { + -- Make sure to use the names found in `:Mason` + ensure_installed = { + -- install language servers + "lua-language-server", + + -- install formatters "stylua", - -- add more arguments for adding more null-ls sources - }) - end, - }, - { - "jay-babu/mason-nvim-dap.nvim", - -- overrides `require("mason-nvim-dap").setup(...)` - opts = function(_, opts) - -- add more things to the ensure_installed table protecting against community packs modifying it - opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { - "python", - -- add more arguments for adding more debuggers - }) - end, + + -- install debuggers + "debugpy", + + -- install any other package + "tree-sitter-cli", + }, + }, }, } diff --git a/lua/plugins/user.lua b/lua/plugins/user.lua index e31ac15..f1dcf21 100644 --- a/lua/plugins/user.lua +++ b/lua/plugins/user.lua @@ -1,4 +1,5 @@ -- You can also add or configure plugins by creating files in this `plugins/` folder +-- PLEASE REMOVE THE EXAMPLES YOU HAVE NO INTEREST IN BEFORE ENABLING THIS FILE -- Here are some examples: ---@type LazySpec @@ -14,26 +15,30 @@ return { config = function() require("lsp_signature").setup() end, }, - -- customize alpha options + -- == Examples of Overriding Plugins == + + -- customize dashboard options { - "goolord/alpha-nvim", - opts = function(_, opts) - -- customize the dashboard header - opts.section.header.val = { - " █████ ███████ ████████ ██████ ██████", - "██ ██ ██ ██ ██ ██ ██ ██", - "███████ ███████ ██ ██████ ██ ██", - "██ ██ ██ ██ ██ ██ ██ ██", - "██ ██ ███████ ██ ██ ██ ██████", - " ", - " ███  ██ ██  ██ ██ ███  ███", - " ████  ██ ██  ██ ██ ████  ████", - " ██ ██  ██ ██  ██ ██ ██ ████ ██", - " ██  ██ ██  ██  ██  ██ ██  ██  ██", - " ██   ████   ████   ██ ██      ██", - } - return opts - end, + "folke/snacks.nvim", + opts = { + dashboard = { + preset = { + header = table.concat({ + " █████ ███████ ████████ ██████ ██████ ", + "██ ██ ██ ██ ██ ██ ██ ██", + "███████ ███████ ██ ██████ ██ ██", + "██ ██ ██ ██ ██ ██ ██ ██", + "██ ██ ███████ ██ ██ ██ ██████ ", + "", + "███  ██ ██  ██ ██ ███  ███", + "████  ██ ██  ██ ██ ████  ████", + "██ ██  ██ ██  ██ ██ ██ ████ ██", + "██  ██ ██  ██  ██  ██ ██  ██  ██", + "██   ████   ████   ██ ██      ██", + }, "\n"), + }, + }, + }, }, -- You can disable default plugins as follows: