Scripts2026年7月16日·1 分钟阅读

vim-plug — Minimalist Vim Plugin Manager

Fast parallel plugin installer for Vim and Neovim with lazy loading, branch/tag pinning, and on-demand hooks.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
vim-plug Overview
先审查命令
npx -y tokrepo@latest install 6385b3a9-8135-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

Introduction

vim-plug is a minimalist plugin manager for Vim and Neovim. It downloads and updates plugins in parallel, supports lazy loading to keep startup fast, and requires only a single file to install. Its simple declarative syntax in vimrc makes managing dozens of plugins straightforward.

What vim-plug Does

  • Installs, updates, and removes Vim/Neovim plugins from GitHub or any Git URL
  • Downloads plugins in parallel using job control for fast installs
  • Supports on-demand lazy loading by filetype, command, or mapping
  • Pins plugins to specific branches, tags, or commits
  • Runs post-install hooks for plugins that need compilation

Architecture Overview

vim-plug is a single VimScript file dropped into the autoload directory. When plug#begin() and plug#end() are called, it registers plugin specifications. :PlugInstall and :PlugUpdate spawn parallel Git clone or pull operations using Vim 8 or Neovim job control. Lazy-loaded plugins are added to the runtime path only when their trigger condition fires.

Setup & Configuration

  • Download plug.vim to ~/.vim/autoload/ (Vim) or ~/.local/share/nvim/site/autoload/ (Neovim)
  • Declare plugins between plug#begin('~/.vim/plugged') and plug#end() in your vimrc
  • Use Plug 'owner/repo', { 'branch': 'main' } to pin to a specific branch
  • Use { 'on': 'NERDTreeToggle' } or { 'for': 'python' } for lazy loading
  • Run :PlugClean to remove plugins no longer listed in your config

Key Features

  • Single-file installation with no dependencies beyond Git
  • Parallel downloads via Vim 8 / Neovim job control
  • On-demand loading by command, filetype, or key mapping
  • Shallow clone by default to minimize disk and network usage
  • Rollback support via :PlugDiff and :PlugSnapshot

Comparison with Similar Tools

  • lazy.nvim — Neovim-only with Lua config and automatic lazy loading, vim-plug works with both Vim and Neovim
  • Vundle — sequential installs, vim-plug is parallel and faster
  • Pathogen — no install/update commands, vim-plug manages the full lifecycle
  • packer.nvim — Lua-based and archived, vim-plug is actively maintained VimScript

FAQ

Q: Does vim-plug work with Neovim? A: Yes. It supports both Vim 8+ and Neovim with the same syntax.

Q: How do I update all plugins? A: Run :PlugUpdate inside Vim. It pulls changes for all registered plugins in parallel.

Q: Can I use vim-plug with Lua-based Neovim configs? A: Yes. Call vim-plug functions from Lua with vim.call('plug#begin') and vim.cmd('Plug ...').

Q: What happens if a plugin install fails? A: vim-plug shows errors in its status window. You can retry with :PlugInstall or check the log with :PlugStatus.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产