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/init.lua | 149 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 115 insertions(+), 34 deletions(-) (limited to 'home/.config/nvim/init.lua') diff --git a/home/.config/nvim/init.lua b/home/.config/nvim/init.lua index 860c876..e3334a7 100644 --- a/home/.config/nvim/init.lua +++ b/home/.config/nvim/init.lua @@ -7,41 +7,122 @@ _G.P = function(v) return v end -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "--branch=stable", - lazyrepo, - lazypath, - }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end -end -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup({ import = "plugins" }, { - defaults = { - version = "*", - }, - change_detection = { - notify = false, - }, - rocks = { - enabled = false, - hererocks = false, - }, +-- Pre-load globals (must be set before plugins load) +vim.g.copilot_nes_debounce = 500 + +-- Build hooks for plugins that need post-install steps +vim.api.nvim_create_autocmd("User", { + pattern = "PackChanged", + callback = function(ev) + if ev.data.kind ~= "install" and ev.data.kind ~= "update" then + return + end + if ev.data.spec.name == "markdown-preview.nvim" then + vim.system({ "yarn", "install" }, { cwd = ev.data.path .. "/app" }) + end + end, }) +local gh = function(x) + return "https://github.com/" .. x +end + +vim.pack.add({ + -- UI + gh("ellisonleao/gruvbox.nvim"), + gh("saghen/blink.indent"), + gh("nvim-lualine/lualine.nvim"), + gh("AndreM222/copilot-lualine"), + + -- Treesitter + { src = gh("nvim-treesitter/nvim-treesitter"), version = "main" }, + gh("RRethy/nvim-treesitter-endwise"), + gh("nvim-treesitter/nvim-treesitter-context"), + gh("JoosepAlviste/nvim-ts-context-commentstring"), + gh("aaronik/treewalker.nvim"), + gh("LiadOz/nvim-dap-repl-highlights"), + + -- Completion + gh("saghen/blink.compat"), + { src = gh("saghen/blink.cmp"), version = vim.version.range("*") }, + gh("rafamadriz/friendly-snippets"), + gh("fang2hou/blink-copilot"), + gh("rcarriga/cmp-dap"), + gh("xzbdmw/colorful-menu.nvim"), + { src = gh("saghen/blink.pairs"), version = vim.version.range("*") }, + { src = gh("saghen/blink.download"), version = vim.version.range("*") }, + + -- Editing + gh("nmac427/guess-indent.nvim"), + gh("kylechui/nvim-surround"), + gh("chrisgrieser/nvim-various-textobjs"), + gh("monaqa/dial.nvim"), + gh("ThePrimeagen/refactoring.nvim"), + gh("nvim-lua/plenary.nvim"), + + -- Git + gh("akinsho/git-conflict.nvim"), + gh("NeogitOrg/neogit"), + gh("ruifm/gitlinker.nvim"), + gh("lewis6991/gitsigns.nvim"), + + -- LSP + gh("folke/lazydev.nvim"), + gh("neovim/nvim-lspconfig"), + gh("j-hui/fidget.nvim"), + gh("williamboman/mason.nvim"), + gh("williamboman/mason-lspconfig.nvim"), + gh("WhoIsSethDaniel/mason-tool-installer.nvim"), + gh("stevearc/conform.nvim"), + gh("mrcjkb/rustaceanvim"), + gh("mfussenegger/nvim-lint"), + gh("rachartier/tiny-inline-diagnostic.nvim"), + + -- Debug + { src = gh("miroshQa/debugmaster.nvim"), version = "dashboard" }, + gh("mfussenegger/nvim-dap"), + gh("theHamsta/nvim-dap-virtual-text"), + gh("jay-babu/mason-nvim-dap.nvim"), + + -- Runner + gh("stevearc/overseer.nvim"), + + -- Search + { src = gh("ibhagwan/fzf-lua"), version = "main" }, + + -- Session + gh("rmagatti/auto-session"), + + -- AI + gh("zbirenbaum/copilot.lua"), + gh("copilotlsp-nvim/copilot-lsp"), + + -- Misc + gh("iamcco/markdown-preview.nvim"), + gh("aserowy/tmux.nvim"), + gh("folke/which-key.nvim"), + gh("stevearc/quicker.nvim"), + gh("stevearc/oil.nvim"), +}, { confirm = false }) + +-- Colorscheme (must be set immediately after plugins are on rtp) +require("gruvbox").setup({}) +vim.o.background = "dark" +vim.cmd.colorscheme("gruvbox") + +-- Plugin configurations (order matters for dependencies) +require("plugins.ui") +require("plugins.treesitter") +require("plugins.completion") +require("plugins.editing") +require("plugins.git") +require("plugins.lsp") +require("plugins.debug") +require("plugins.runner") +require("plugins.search") +require("plugins.session") +require("plugins.ai") +require("plugins.init") + require("config.keymaps") require("config.autocmds") -- cgit v1.2.3-70-g09d2