Packer Bootstrapping, why using the packadd cmd?

HI,

First all the code can be found HERE !

When I check the doc of packadd, it is mentioned

Search for an optional plugin directory in ‘packpath’ and source any plugin files found. The directory must match: pack/*/opt/{name}

Then this command is used to install packer, vim.cmd [[packadd packer.nvim]] however packer.nvim is installed in the start directory fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'

is packadd the only way to load dynamically a package ?

The start path is mentioned in the documentation of packadd but I don’t understand it.

If loading packages from "pack//start" was skipped,then this directory is searched first: pack//start/{name}

if someone can help me, why using packadd makes sense ?

Tks ~

It is required during bootstrapping because it wasn’t in the packpath when nvim was opened. If installed in /start/ you will not need to use packadd going forward.

If installed in /opt/ then packadd must be used each time, otherwise the plugin will never be loaded.

1 Like