Archived post: posted sometime between 2016 and 2022.

Notes on Vim's native package manager

These are high-level notes on how to use Vim's native package manager.

It has been available since Vim v8.

Read the manual with :help packages .

Many people use git-submodules for package management.

What does Vim do when Vim starts?

  1. Process your .vimrc file, and then load plugins as follows.
  2. Scan for directories under pack/*/start/ (these are the plugins).
  3. Add those directories to runtimepath .
  4. Load the associated plugins.
  5. If appropriate, load the appropriate syntax.

Running packloadall in .vimrc will load plugins earlier.

Directory structure:

~/.vim
  pack/
    <packageName1>/
      README
      start/ <-------- loaded automatically
        <pluginName1>/
          plugin/ <------- the plugin files 
          syntax/ <------- its syntax files
        <pluginName2>/
          plugin/
          syntax/
      opt/ <----------- loaded optionally
        <pluginName3>/
          plugin/
          syntax/
        <pluginName4>/
          plugin/
          syntax/