Skip to content

Migrate Neovim plugins from Packer to lazy.nvim#17

Open
akan72 wants to merge 1 commit into
mainfrom
akan72/nvim-lazy-migration
Open

Migrate Neovim plugins from Packer to lazy.nvim#17
akan72 wants to merge 1 commit into
mainfrom
akan72/nvim-lazy-migration

Conversation

@akan72
Copy link
Copy Markdown
Owner

@akan72 akan72 commented May 29, 2026

Summary

Branch 5: migrate Neovim plugin management from Packer → lazy.nvim.

  • Replace Packer bootstrap with lazy.nvim bootstrap pinned to v11.17.5 (self-installs on first launch)
  • Convert all use{} specs to lazy {} specs: runbuild, requiresdependencies
  • Set mapleader before lazy.setup so lazy keys specs bind correctly
  • Add priority = 1000 (+ lazy = false) to the gruvbox colorscheme
  • Remove the BufWritePost PackerCompile autocmd
  • Lazy-load: telescope (keys + :Telescope), fugitive (:Git/:G + <leader>gs), markdown-preview (ft = markdown)
  • Fix nvim-treesitter ensure_installed: "help""vimdoc" (parser renamed)
  • Delete nvim/coc-settings.json (unused — config uses lsp-zero + Mason)
  • Remove nvim/plugin/ from .gitignore (Packer artifact dir)
  • assimilate.sh: drop the packer clone + PackerSync; lazy self-bootstraps and we trigger a headless Lazy! sync

Notes / deviations

  • lsp.lua already used ts_ls (not tsserver), so the planned rename was a no-op.
  • Kept the vim.tbl_flatten shim in init.lua. The plan lists removing it, but the still-pinned old plugin versions (e.g. telescope 0.1.1) reference vim.tbl_flatten, which is gone in nvim 0.11+. Removing the shim now would break them — it should be removed only after unpinning to newer versions (a later plan step). The shim is a no-op when unused, so keeping it is strictly safer.
  • lazy-lock.json is not committed yet — it's generated on the first interactive launch. After merging: open nvim, let lazy install, run :Lazy to verify, then commit the lockfile.

Why & alternatives (from explanations.txt — Branch 5)

Change Why Alternatives
Migrate Packer → lazy.nvim Packer archived since Aug 2023. lazy.nvim is the standard: lazy-lock.json (transitive pinning), lazy loading, built-in UI. Stick with Packer (unmaintained, risk grows) or vim-plug (older).
Delete coc-settings.json Config uses lsp-zero + Mason — CoC is a different framework. Dead file. Keep if switching back to CoC (unlikely).
Keep/remove vim.tbl_flatten shim Only needed for old pinned treesitter/telescope. Kept as safety net until plugins are unpinned (harmless).
"help""vimdoc" parser Treesitter renamed the parser; old name warns. None — just a rename.
tsserverts_ls mason-lspconfig renamed it. Already ts_ls — no change needed.
Remove nvim/plugin/ from .gitignore Packer artifact location; lazy doesn't use it. None.
Update assimilate.sh (remove Packer clone) lazy self-bootstraps from config. Leave for now to roll back easily.
Add lazy-loading triggers Faster startup — telescope on <C-p>, fugitive on :Git, etc. Load everything eagerly (simpler, slower).

lazy-lock.json will be generated on first launch; commit it after verifying everything works locally.

- Replace Packer bootstrap with lazy.nvim bootstrap pinned to v11.17.5
  (self-installs on first launch)
- Convert all use{} specs to lazy {} specs: run -> build, requires -> dependencies
- Set mapleader before lazy.setup so lazy 'keys' specs bind correctly
- Add priority = 1000 + lazy = false to the gruvbox colorscheme
- Remove the BufWritePost PackerCompile autocmd
- Lazy-load: telescope (keys + :Telescope), fugitive (:Git/:G + <leader>gs),
  markdown-preview (ft = markdown)
- Fix nvim-treesitter ensure_installed: 'help' -> 'vimdoc' (parser renamed)
- Delete nvim/coc-settings.json (unused; config uses lsp-zero + Mason)
- Remove nvim/plugin/ from .gitignore (Packer artifact dir; lazy doesn't use it)
- assimilate.sh: drop the packer clone + PackerSync; lazy self-bootstraps and we
  trigger a headless 'Lazy\! sync' instead

Notes:
- lsp.lua already used 'ts_ls' (not 'tsserver'), so no rename was needed there.
- Kept the vim.tbl_flatten shim in init.lua: the still-pinned old plugin
  versions (e.g. telescope 0.1.1) reference it; remove only after unpinning.
- lazy-lock.json is generated on first interactive launch — run nvim, let lazy
  install, verify (:Lazy), then commit the lockfile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant