Neovim vim-pack

Neovim’s built-in plugin manager.

vim.pack is a Lua API shipped in Neovim’s core since 0.12, not a standalone binary: each operation below is a Lua one-liner evaluated by a throw-away Neovim process. Plugins are Git clones under stdpath('data')/site/pack/core/opt, pinned by a nvim-pack-lock.json lock file in stdpath('config').

Note

Every invocation runs --clean, so the user’s init.lua is never sourced. vim.pack.get() reads the lock file rather than the current session, so the inventory stays complete without paying for, nor being perturbed by, a full editor startup. stdpath() is XDG-derived and --clean does not move it, so both the lock file and the plugin directory still resolve.

Caution

Neovim exits 0 even when a -c command raises, which would hide every failure from mpm. Vim_Pack.post_args therefore closes each invocation with -c 'cquit': on success the Lua payload has already called os.exit(0), and on error control falls through to that gate and Neovim exits 1.

Caution

Installing a plugin registers it in the lock file and clones it to disk, but mpm does not edit the user’s init.lua. A plugin installed through mpm is therefore on disk but not loaded by the next editor start until a matching vim.pack.add() call is added to the configuration.

Note

Packages are keyed on their src URL. vim.pack accepts no registry shorthand: Vim_Pack.install() needs a URL while Vim_Pack.remove() and Vim_Pack.upgrade_one_cli() address plugins by the short name Neovim derives from it, so the URL is the only identifier mpm can feed back into every operation. Package ids therefore round-trip through install, remove, upgrade and backup/restore.

Note

No outdated: vim.pack exposes no read-only “list upgradable” call. vim.pack.update() fetches and then either applies the new revisions or renders them into a confirmation buffer, neither of which mpm can consume as a query, so mpm auto-skips the operation and upgrade --all still works.

What mpm adds to vim-pack

mpm reaches across every manager at once, not vim-pack alone: mpm installed and mpm outdated cover vim-pack alongside every other manager you run in one table, mpm upgrade --all updates them together, and mpm sbom exports the whole machine as one bill of materials.

Every mpm command also gains --dry-run and --plan previews, cross-scheme version comparison and purl identifiers. See manager augmentations for how each one is built.

Your vim-pack commands, in mpm

You already know vim-pack: each operation maps one-to-one onto mpm, in an interface shared by every manager.

To…

With vim-pack

With mpm

List what’s installed

nvim 'lua io.write(vim.json.encode(vim.pack.get(nil, {info = false}))) os.exit(0)' 'cquit'

mpm --vim-pack installed

Install a package

nvim 'lua vim.pack.add({{src = "https://github.com/tpope/vim-sensible"}}, {confirm = false, load = false}) os.exit(0)' 'cquit'

mpm install pkg:vim-pack/cquit

Upgrade one package

nvim 'lua for _, p in ipairs(vim.pack.get(nil, {info = false})) do if p.spec.src == "https://github.com/tpope/vim-sensible" then vim.pack.update({p.spec.name}, {force = true}) end end os.exit(0)' 'cquit'

mpm --vim-pack upgrade cquit

Upgrade everything

nvim 'lua vim.pack.update(nil, {force = true}) os.exit(0)' 'cquit'

mpm --vim-pack upgrade --all

Remove a package

nvim 'lua for _, p in ipairs(vim.pack.get(nil, {info = false})) do if p.spec.src == "https://github.com/tpope/vim-sensible" then vim.pack.del({p.spec.name}, {force = true}) end end os.exit(0)' 'cquit'

mpm remove pkg:vim-pack/cquit

Prefix any command above with --dry-run to simulate the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.

Platforms

  • 🅱️ BSD

  • 🐧 Linux

  • 🍎 macOS

  • ⨂ Unix

  • 🪟 Windows

Operations

Operation

Supported

installed

outdated

orphans

search

install

upgrade

upgrade_all

remove

sync

cleanup

doctor

Ecosystem

  • Accepted purl types: pkg:vim-pack

Selecting and configuring vim-pack

Deselect vim-pack for a single run with --no-vim-pack, or persist the choice in your configuration:

[mpm]
vim-pack = false

Keep it enabled but tune how mpm drives it with a per-manager override:

[mpm.managers.vim-pack]
timeout = 900

mpm config-template vim-pack prints every overridable attribute as a ready-to-paste block.

Recipes

A few jobs you would otherwise script around vim-pack, one mpm command each:

  • Snapshot and clone a machine: mpm --vim-pack dump vim-pack.toml, then mpm restore vim-pack.toml on the next one.

  • Export a compliance SBOM: mpm --vim-pack sbom (CycloneDX by default, --spdx for SPDX).

How mpm drives vim-pack

  • CLI names, in lookup order: nvim

  • Arguments forced before each call: --clean --headless

  • Arguments forced after each call: -c cquit

mpm forces those arguments and variables on every call, so runs stay quiet, non-interactive and reproducible: the defaults you would set in CI anyway.

The version is probed by running:

$ nvim --version
NVIM v0.12.4
Build type: Release
LuaJIT 2.1.1785763465

and extracted with:

r"NVIM\s+v(?P<version>\S+)"

Privilege escalation

mpm runs this manager as the current user and never prepends sudo by default. Flip the policy for its privileged operations with --sudo or the per-manager sudo override.

See privilege escalation for the full policy.

Cooldown

State of Neovim vim-pack’s release-age gating, from the cooldown support table:

  • Status: ❌ None

A cooldown only pays off where a compromised release can be withdrawn while the clock runs, and can only be emulated where the registry dates its releases. From the retraction table:

  • Registry: Upstream Git clones

  • Retraction: None: a plugin is cloned straight from its upstream repository, so withdrawing a bad revision is its author force-pushing, retagging or deleting it themselves. No index sits in between

  • Publish date: ❌ a commit or tag date is set by the author and freely rewritable

With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --allow-unsupported-managers opts back in.

Reference traces

Raw native outputs captured in the manager source: the reference mpm’s parsers were written against. If you know Neovim vim-pack well and a transcript below looks wrong, or a newer release changed its output format, report it.

$ nvim --clean --headless \
> -c 'lua io.write(vim.json.encode(vim.pack.get(nil, {info = false}))) os.exit(0)' \
> -c 'cquit'
[{"active":false,"rev":"0ce2d843d6f588bb0c8c7eec6449171615dc56d9","spec":{"name":"vim-sensible","src":"https://github.com/tpope/vim-sensible"},"path":"/home/kev/.local/share/nvim/site/pack/core/opt/vim-sensible"},{"active":false,"rev":"a2e1f2b2e2e5a4c1d0f9b8a7c6d5e4f3a2b1c0d9","spec":{"name":"plenary.nvim","src":"https://github.com/nvim-lua/plenary.nvim"},"path":"/home/kev/.local/share/nvim/site/pack/core/opt/plenary.nvim"}]

Feed any of these through mpm and the raw output becomes one uniform table, the same shape for every manager: filter it, project columns, or export it (mpm --vim-pack installed --output json, or csv, toml, yaml), each package carrying a purl and a version comparable across managers.