diff --git a/modules/home-manager/programs/neovim/default.nix b/modules/home-manager/programs/neovim/default.nix index 50acbfc..367563f 100644 --- a/modules/home-manager/programs/neovim/default.nix +++ b/modules/home-manager/programs/neovim/default.nix @@ -95,8 +95,10 @@ in marksman # Nix + deadnix nixd nixfmt-rfc-style + statix # Python basedpyright diff --git a/modules/home-manager/programs/neovim/lua/community.lua b/modules/home-manager/programs/neovim/lua/community.lua index 0afc97f..13881f3 100644 --- a/modules/home-manager/programs/neovim/lua/community.lua +++ b/modules/home-manager/programs/neovim/lua/community.lua @@ -26,7 +26,6 @@ return { { import = "astrocommunity.pack.json" }, { import = "astrocommunity.pack.lua" }, { import = "astrocommunity.pack.markdown" }, - { import = "astrocommunity.pack.nix" }, { import = "astrocommunity.pack.rust" }, { import = "astrocommunity.pack.toml" }, { import = "astrocommunity.pack.typescript-all-in-one" }, diff --git a/modules/home-manager/programs/neovim/lua/plugins/astrocore.lua b/modules/home-manager/programs/neovim/lua/plugins/astrocore.lua index ed325ae..c558b1c 100644 --- a/modules/home-manager/programs/neovim/lua/plugins/astrocore.lua +++ b/modules/home-manager/programs/neovim/lua/plugins/astrocore.lua @@ -11,11 +11,11 @@ return { -- Configure core features of AstroNvim features = { large_buf = { size = 1024 * 500, lines = 10000 }, -- set global limits for large files for disabling features like treesitter - autopairs = true, -- 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) - highlighturl = true, -- highlight URLs at start - notifications = true, -- enable notifications at start + autopairs = true, -- 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) + highlighturl = true, -- highlight URLs at start + notifications = true, -- enable notifications at start }, -- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on diagnostics = { @@ -24,20 +24,20 @@ return { }, -- vim options can be configured here options = { - opt = { -- vim.opt. - autoindent = true, -- indents automatically based on context - expandtab = true, -- use spaces instead of tabs + opt = { -- vim.opt. + autoindent = true, -- indents automatically based on context + expandtab = true, -- use spaces instead of tabs grepprg = "rg --vimgrep", -- use ripgrep on grep actions - number = true, -- sets vim.opt.number - relativenumber = true, -- sets vim.opt.relativenumber - shiftwidth = 2, -- how many spaces after indentation - signcolumn = "auto", -- sets vim.opt.signcolumn to auto - smartindent = true, -- smartly indent - spell = false, -- sets vim.opt.spell - tabstop = 2, -- how many spaces to indent when pressing tab - wrap = false, -- sets vim.opt.wrap + number = true, -- sets vim.opt.number + relativenumber = true, -- sets vim.opt.relativenumber + shiftwidth = 2, -- how many spaces after indentation + signcolumn = "auto", -- sets vim.opt.signcolumn to auto + smartindent = true, -- smartly indent + spell = false, -- sets vim.opt.spell + tabstop = 2, -- how many spaces to indent when pressing tab + wrap = false, -- sets vim.opt.wrap }, - g = { -- vim.g. + g = { -- vim.g. -- configure global vim variables (vim.g) -- NOTE: `mapleader` and `maplocalleader` must be set in the AstroNvim opts or before `lazy.setup` -- This can be found in the `lua/lazy_setup.lua` file diff --git a/modules/home-manager/programs/neovim/lua/plugins/none-ls.lua b/modules/home-manager/programs/neovim/lua/plugins/none-ls.lua index 3d13017..9a918b2 100644 --- a/modules/home-manager/programs/neovim/lua/plugins/none-ls.lua +++ b/modules/home-manager/programs/neovim/lua/plugins/none-ls.lua @@ -42,7 +42,7 @@ return { -- Check supported formatters and linters -- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/formatting -- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics - config.sources = { + config.sources = require("astrocore").list_insert_unique(config.sources, { -- Set a formatter require("none-ls.diagnostics.flake8"), require("none-ls.formatting.ruff"), @@ -54,7 +54,11 @@ return { null_ls.builtins.formatting.stylua, --deno_fmt, null_ls.builtins.formatting.prettierd, - } + + null_ls.builtins.code_actions.statix, + + null_ls.builtins.diagnostics.deadnix, + }) return config -- return final config table end, } diff --git a/modules/home-manager/programs/neovim/lua/plugins/nvim-lint.lua b/modules/home-manager/programs/neovim/lua/plugins/nvim-lint.lua new file mode 100644 index 0000000..83ee6fc --- /dev/null +++ b/modules/home-manager/programs/neovim/lua/plugins/nvim-lint.lua @@ -0,0 +1,11 @@ +return { + { + "mfussenegger/nvim-lint", + optional = true, + opts = { + linters_by_ft = { + nix = { "statix", "deadnix" }, + }, + }, + }, +}