From b57dc94d3a6aacc1f0050ae6d3f55f7ad4d27e29 Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Tue, 21 Oct 2025 21:03:41 +0200 Subject: [PATCH 1/3] feat: move plugin install definitions to their dirs. --- lua/config/pack.lua | 6 ------ lua/plugins/colorscheme.lua | 3 +++ lua/plugins/lsp.lua | 4 ++++ lua/plugins/mini.lua | 4 ++++ lua/plugins/treesitter.lua | 3 +++ 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lua/config/pack.lua b/lua/config/pack.lua index 2aff5f1..3971000 100644 --- a/lua/config/pack.lua +++ b/lua/config/pack.lua @@ -1,10 +1,4 @@ vim.pack.add({ - -- Colorscheme - { src = "https://github.com/ellisonleao/gruvbox.nvim" }, - -- Treesitter parsers - { src = "https://github.com/nvim-treesitter/nvim-treesitter" }, -- Preconfigured lsp's { src = "https://github.com/neovim/nvim-lspconfig" }, - -- Amazing neovim bundle of plugins that are super nice - { src = "https://github.com/nvim-mini/mini.nvim" }, }) diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index f82912a..5e1b401 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -1,2 +1,5 @@ +vim.pack.add({ + { src = "https://github.com/ellisonleao/gruvbox.nvim" }, +}) vim.o.background = "dark" vim.cmd([[colorscheme gruvbox]]) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 7145821..ceef42a 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,3 +1,7 @@ +vim.pack.add({ + { src = "https://github.com/folke/lazydev.nvim" } +}) + -- Enable some settings globally vim.lsp.config("*", { -- allow for multiline token support diff --git a/lua/plugins/mini.lua b/lua/plugins/mini.lua index 609c836..6736966 100644 --- a/lua/plugins/mini.lua +++ b/lua/plugins/mini.lua @@ -1,3 +1,7 @@ +vim.pack.add({ + { src = "https://github.com/nvim-mini/mini.nvim" }, +}) + -- setup picker with icons require("mini.icons").setup() require("mini.pick").setup({ diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 86f54b1..cdf9800 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,3 +1,6 @@ +vim.pack.add({ + { src = "https://github.com/nvim-treesitter/nvim-treesitter" }, +}) ---@diagnostic disable: missing-fields require("nvim-treesitter.configs").setup({ ensure_installed = { "go", "nix" }, From b27714866fce8f00621b12b5baf9611c3c930bba Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Tue, 21 Oct 2025 21:04:04 +0200 Subject: [PATCH 2/3] feat: .lua_ls.rc won't fix all issues --- .luarc.json | 14 -------------- lua/plugins/lsp.lua | 3 +++ nvim-pack-lock.json | 4 ++++ 3 files changed, 7 insertions(+), 14 deletions(-) delete mode 100644 .luarc.json diff --git a/.luarc.json b/.luarc.json deleted file mode 100644 index 96d006c..0000000 --- a/.luarc.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "runtime.version": "LuaJIT", - "runtime.path": [ - "lua/?.lua", - "lua/?.init.lua" - ], - "diagnostics.globals": [ - "vim" - ], - "workspace.checkThirdParty": false, - "workspace.library": [ - "$VIMRUNTIME" - ] -} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index ceef42a..051662c 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -34,3 +34,6 @@ vim.lsp.enable({ -- diagnostic settings vim.diagnostic.config({ virtual_text = true }) + +-- fix annoying lua lsp errors +require("lazydev").setup() diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index 8d2582e..93b6c2f 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -4,6 +4,10 @@ "rev": "5e0a460", "src": "https://github.com/ellisonleao/gruvbox.nvim" }, + "lazydev.nvim": { + "rev": "e28ce52", + "src": "https://github.com/folke/lazydev.nvim" + }, "mini.nvim": { "rev": "cf32454", "src": "https://github.com/nvim-mini/mini.nvim" From 5501a8027a263ee345f405f858854ad5e50efea7 Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Tue, 21 Oct 2025 21:04:19 +0200 Subject: [PATCH 3/3] feat(pack): run TSUpdate when updating treesitter --- lua/plugins/treesitter.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index cdf9800..732bc58 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -21,3 +21,21 @@ require("nvim-treesitter.configs").setup({ }, }, }) + +-- run tsupdate when updating nvim-treesitter +vim.api.nvim_create_autocmd('PackChanged', { + desc = 'Handle nvim-treesitter updates', + group = vim.api.nvim_create_augroup('nvim-treesitter-pack-changed-update-handler', { clear = true }), + callback = function(event) + if event.data.kind == 'update' and event.data.spec.name == 'nvim-treesitter' then + vim.notify('nvim-treesitter updated, running TSUpdate...', vim.log.levels.INFO) + ---@diagnostic disable-next-line: param-type-mismatch + local ok = pcall(vim.cmd, 'TSUpdate') + if ok then + vim.notify('TSUpdate completed successfully!', vim.log.levels.INFO) + else + vim.notify('TSUpdate command not available yet, skipping', vim.log.levels.WARN) + end + end + end, +})