# junegunn/vim-plug architecture

> Architecture diagram of the GitHub repository junegunn/vim-plug, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/junegunn/vim-plug
- Repository: https://github.com/junegunn/vim-plug

## Overview

vim-plug is a single-file Vim/Neovim plugin manager. Users declare plugins between `plug#begin()` and `plug#end()`, then invoke management commands to install, update, review, or clean them. The README also documents on-demand loading, hooks, version selection, and support for externally managed plugins. Source excerpts were unavailable, so relationships below are limited to documented behavior; implementation paths point to the sole runtime file.

Main entry points: [`plug.vim`](https://github.com/junegunn/vim-plug/blob/master/plug.vim) (vim-plug runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_configuration["Plugin configuration"]
  node_declarations["Plugin declarations<br/>[plug.vim]"]
end

subgraph group_management["Plugin management"]
  node_manager["vim-plug runtime<br/>[plug.vim]"]
  node_install["Install plugins<br/>[plug.vim]"]
  node_update["Update plugins<br/>[plug.vim]"]
  node_review["Review changes<br/>[plug.vim]"]
  node_clean["Clean unused<br/>[plug.vim]"]
  node_plugin_dirs[("Plugin directories<br/>[plug.vim]")]
  node_git_repos[("Plugin Git repositories")]
  node_hooks["Post-update hooks<br/>[plug.vim]"]
end

subgraph group_loading["Loading and integration"]
  node_on_demand["On-demand loading<br/>[plug.vim]"]
  node_runtime_path["Runtime path setup<br/>[plug.vim]"]
end

node_user(("Vim user"))
node_vim(("Vim / Neovim"))

node_user -->|"declares plugins"| node_declarations
node_user -->|"invokes commands"| node_manager
node_declarations -->|"configures"| node_manager
node_manager -->|"dispatches"| node_install
node_manager -->|"dispatches"| node_update
node_manager -->|"dispatches"| node_review
node_manager -->|"dispatches"| node_clean
node_install -->|"clones shallowly"| node_git_repos
node_update -->|"updates"| node_git_repos
node_install -->|"installs into"| node_plugin_dirs
node_update -->|"runs after update"| node_hooks
node_review -->|"reviews changes"| node_git_repos
node_clean -->|"removes unused"| node_plugin_dirs
node_declarations -->|"sets load options"| node_on_demand
node_manager -->|"configures"| node_runtime_path
node_runtime_path -->|"enables plugins"| node_vim
node_on_demand -->|"loads on demand"| node_vim

click node_declarations "https://github.com/junegunn/vim-plug/blob/master/plug.vim"
click node_manager "https://github.com/junegunn/vim-plug/blob/master/plug.vim"
click node_install "https://github.com/junegunn/vim-plug/blob/master/plug.vim"
click node_update "https://github.com/junegunn/vim-plug/blob/master/plug.vim"
click node_review "https://github.com/junegunn/vim-plug/blob/master/plug.vim"
click node_clean "https://github.com/junegunn/vim-plug/blob/master/plug.vim"
click node_plugin_dirs "https://github.com/junegunn/vim-plug/blob/master/plug.vim"
click node_hooks "https://github.com/junegunn/vim-plug/blob/master/plug.vim"
click node_on_demand "https://github.com/junegunn/vim-plug/blob/master/plug.vim"
click node_runtime_path "https://github.com/junegunn/vim-plug/blob/master/plug.vim"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_declarations,node_user toneBlue
class node_manager,node_install,node_update,node_review,node_clean,node_plugin_dirs,node_git_repos,node_hooks toneAmber
class node_on_demand,node_runtime_path toneMint
class node_vim toneIndigo
```

## Components

### Plugin configuration

- [Plugin declarations](https://github.com/junegunn/vim-plug/blob/master/plug.vim): `plug.vim`

### Plugin management

- [vim-plug runtime](https://github.com/junegunn/vim-plug/blob/master/plug.vim): `plug.vim`
- [Install plugins](https://github.com/junegunn/vim-plug/blob/master/plug.vim): `plug.vim`
- [Update plugins](https://github.com/junegunn/vim-plug/blob/master/plug.vim): `plug.vim`
- [Review changes](https://github.com/junegunn/vim-plug/blob/master/plug.vim): `plug.vim`
- [Clean unused](https://github.com/junegunn/vim-plug/blob/master/plug.vim): `plug.vim`
- [Plugin directories](https://github.com/junegunn/vim-plug/blob/master/plug.vim): `plug.vim`
- **Plugin Git repositories**
- [Post-update hooks](https://github.com/junegunn/vim-plug/blob/master/plug.vim): `plug.vim`

### Loading and integration

- [On-demand loading](https://github.com/junegunn/vim-plug/blob/master/plug.vim): `plug.vim`
- [Runtime path setup](https://github.com/junegunn/vim-plug/blob/master/plug.vim): `plug.vim`

### Other components

- **Vim user**
- **Vim / Neovim**

## Connections

- Vim user → Plugin declarations: declares plugins (evidence: `README.md`)
- Vim user → vim-plug runtime: invokes commands (evidence: `README.md`)
- Plugin declarations → vim-plug runtime: configures (evidence: `README.md`)
- vim-plug runtime → Install plugins: dispatches (evidence: `README.md`)
- vim-plug runtime → Update plugins: dispatches (evidence: `README.md`)
- vim-plug runtime → Review changes: dispatches (evidence: `README.md`)
- vim-plug runtime → Clean unused: dispatches (evidence: `README.md`)
- Install plugins → Plugin Git repositories: clones shallowly (evidence: `README.md`)
- Update plugins → Plugin Git repositories: updates (evidence: `README.md`)
- Install plugins → Plugin directories: installs into (evidence: `README.md`)
- Update plugins → Post-update hooks: runs after update (evidence: `README.md`)
- Review changes → Plugin Git repositories: reviews changes (evidence: `README.md`)
- Clean unused → Plugin directories: removes unused (evidence: `README.md`)
- Plugin declarations → On-demand loading: sets load options (evidence: `README.md`)
- vim-plug runtime → Runtime path setup: configures (evidence: `README.md`)
- Runtime path setup → Vim / Neovim: enables plugins (evidence: `README.md`)
- On-demand loading → Vim / Neovim: loads on demand (evidence: `README.md`)
