Vim Pack
Source: https://echasnovski.com/blog/2026-03-13-a-guide-to-vim-pack.html
vim.packis the built-in Neovim 0.12 plugin manager. Add plugins withvim.pack.add({ ... }); it installs missing Git repos and loads them immediately.- Specs use full Git URLs.
- Table specs use
src, optionalname,version, anddatafields. - For semver tags use
vim.version.range(...).
- Table specs use
- All managed plugins are installed as opt packages in Neovim’s core package
directory and are loaded with
:packaddbyvim.pack.add(). - The lockfile is
nvim-pack-lock.jsonin the config directory. Track it with the config; do not edit it by hand. - Updates are done with
:lua vim.pack.update()(all plugins) or:lua vim.pack.update({ 'plugin-name' }).- Useful options include
{ force = true },{ offline = true }, and{ target = 'lockfile' }.
- Useful options include
- Delete by first removing plugin loading code from the config, then run
:lua vim.pack.del({ 'plugin-name' }). Do not delete managed plugin directories manually. - Hooks are autocommands for
PackChangedPreandPackChanged. Use them for builds or post-update work such asTSUpdate. - Installation hooks must be defined before the
vim.pack.add()that can install the plugin. Defining hooks before the firstvim.pack.add()is the robust approach. - Lazy loading is possible by calling
vim.pack.add()later (for example in avim.schedule()callback or an autocmd), but it is intentionally not front-and-center.- The article recommends starting simple, then adding moderate lazy loading only where worthwhile.
vim.loader.enable()as the first line ofinit.luacan improve startup for non-lazy-loaded configs.