From e01f1d6f5d42fac643facecd9ca2d240d53453bd Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Fri, 17 Apr 2026 10:53:20 +0100 Subject: feat: migrate from lazy.nvim to vim.pack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace lazy.nvim plugin manager with Neovim 0.12's native vim.pack API. All plugin config files rewritten from lazy.nvim spec tables to imperative require/setup format with explicit vim.keymap.set() calls. Key changes: - vim.pack.add() with ~53 plugins in init.lua - blink.cmp/pairs/download pinned to version tags (vim.version.range) - PackChanged autocmd for markdown-preview build hook - Ordered requires: colorscheme → ui → treesitter → completion → lsp → rest - Plugin setup guards (gitsigns, which-key, blink.cmp) handle deferred plugin/ file loading correctly Net reduction: ~438 lines across 13 files. --- home/.config/nvim/lua/plugins/treesitter.lua | 236 ++++++++++----------------- 1 file changed, 84 insertions(+), 152 deletions(-) (limited to 'home/.config/nvim/lua/plugins/treesitter.lua') diff --git a/home/.config/nvim/lua/plugins/treesitter.lua b/home/.config/nvim/lua/plugins/treesitter.lua index 99c9688..8355a07 100644 --- a/home/.config/nvim/lua/plugins/treesitter.lua +++ b/home/.config/nvim/lua/plugins/treesitter.lua @@ -1,153 +1,85 @@ -return { - { - "aaronik/treewalker.nvim", - keys = { - { - "", - "Treewalker Up", - mode = { "n", "v" }, - silent = true, - desc = "Moves up to the previous neighbor node", - }, - { - "", - "Treewalker Down", - mode = { "n", "v" }, - silent = true, - desc = "Moves up to the next neighbor node", - }, - { - "", - "Treewalker Left", - mode = { "n", "v" }, - silent = true, - desc = "Moves to the first ancestor node that's on a different line from the current node", - }, - { - "", - "Treewalker Right", - mode = { "n", "v" }, - silent = true, - desc = "Moves to the next node down that's indented further than the current node", - }, - { - "", - "Treewalker SwapUp", - silent = true, - desc = "Swaps the highest node on the line upwards in the document", - }, - { - "", - "Treewalker SwapDown", - silent = true, - desc = "Swaps the biggest node on the line downward in the document", - }, - { - "", - "Treewalker SwapLeft", - silent = true, - desc = "Swap the node under the cursor with its previous neighbor", - }, - { - "", - "Treewalker SwapRight", - silent = true, - desc = "Swap the node under the cursor with its next neighbor", - }, - }, - opts = {}, - }, - { - "nvim-treesitter/nvim-treesitter", - branch = "main", - lazy = false, - dependencies = { - { - "LiadOz/nvim-dap-repl-highlights", - opts = {}, - }, - }, - build = ":TSUpdate", - config = function() - require("nvim-treesitter").install({ - "awk", - "bash", - "c", - "cmake", - "comment", - "cpp", - "css", - "csv", - "diff", - "dockerfile", - "dap_repl", - "doxygen", - "editorconfig", - "fortran", - "git_config", - "git_rebase", - "gitattributes", - "gitcommit", - "gitignore", - "groovy", - "gpg", - "hlsplaylist", - "html", - "http", - "ini", - "javascript", - "jq", - "jsdoc", - "json", - "just", - "llvm", - "lua", - "luadoc", - "luap", - "make", - "markdown", - "markdown_inline", - "query", - "passwd", - "printf", - "python", - "regex", - "readline", - "requirements", - "rust", - "sql", - "ssh_config", - "strace", - "sxhkdrc", - "tablegen", - "tmux", - "todotxt", - "toml", - "typescript", - "vim", - "vimdoc", - "xcompose", - "xml", - "xresources", - "yaml", - }) - end, - }, - "RRethy/nvim-treesitter-endwise", - { "nvim-treesitter/nvim-treesitter-context", opts = {} }, - { - "JoosepAlviste/nvim-ts-context-commentstring", - config = function() - require("ts_context_commentstring").setup({ - enable_autocmd = false, - }) - local get_option = vim.filetype.get_option +require("treewalker").setup({}) - vim.filetype.get_option = function(filetype, option) - return option == "commentstring" - and require("ts_context_commentstring.internal").calculate_commentstring() - or get_option(filetype, option) - end - end, - }, -} +vim.keymap.set({ "n", "v" }, "", "Treewalker Up", { silent = true, desc = "Moves up to the previous neighbor node" }) +vim.keymap.set({ "n", "v" }, "", "Treewalker Down", { silent = true, desc = "Moves up to the next neighbor node" }) +vim.keymap.set({ "n", "v" }, "", "Treewalker Left", { silent = true, desc = "Moves to the first ancestor node that's on a different line from the current node" }) +vim.keymap.set({ "n", "v" }, "", "Treewalker Right", { silent = true, desc = "Moves to the next node down that's indented further than the current node" }) +vim.keymap.set("n", "", "Treewalker SwapUp", { silent = true, desc = "Swaps the highest node on the line upwards in the document" }) +vim.keymap.set("n", "", "Treewalker SwapDown", { silent = true, desc = "Swaps the biggest node on the line downward in the document" }) +vim.keymap.set("n", "", "Treewalker SwapLeft", { silent = true, desc = "Swap the node under the cursor with its previous neighbor" }) +vim.keymap.set("n", "", "Treewalker SwapRight", { silent = true, desc = "Swap the node under the cursor with its next neighbor" }) + +require("nvim-treesitter").install({ + "awk", + "bash", + "c", + "cmake", + "comment", + "cpp", + "css", + "csv", + "diff", + "dockerfile", + "doxygen", + "editorconfig", + "fortran", + "git_config", + "git_rebase", + "gitattributes", + "gitcommit", + "gitignore", + "groovy", + "gpg", + "hlsplaylist", + "html", + "http", + "ini", + "javascript", + "jq", + "jsdoc", + "json", + "just", + "llvm", + "lua", + "luadoc", + "luap", + "make", + "markdown", + "markdown_inline", + "query", + "passwd", + "printf", + "python", + "regex", + "readline", + "requirements", + "rust", + "sql", + "ssh_config", + "strace", + "sxhkdrc", + "tablegen", + "tmux", + "todotxt", + "toml", + "typescript", + "vim", + "vimdoc", + "xcompose", + "xml", + "xresources", + "yaml", +}) + +require("nvim-dap-repl-highlights").setup({}) +require("treesitter-context").setup({}) + +require("ts_context_commentstring").setup({ + enable_autocmd = false, +}) +local get_option = vim.filetype.get_option +vim.filetype.get_option = function(filetype, option) + return option == "commentstring" + and require("ts_context_commentstring.internal").calculate_commentstring() + or get_option(filetype, option) +end -- cgit v1.2.3-70-g09d2