{"id":13428217,"url":"https://github.com/junegunn/vim-plug","last_synced_at":"2025-05-12T03:40:25.462Z","repository":{"id":10537682,"uuid":"12732573","full_name":"junegunn/vim-plug","owner":"junegunn","description":":hibiscus: Minimalist Vim Plugin Manager","archived":false,"fork":false,"pushed_at":"2025-03-29T05:17:01.000Z","size":9020,"stargazers_count":34820,"open_issues_count":81,"forks_count":1954,"subscribers_count":373,"default_branch":"master","last_synced_at":"2025-05-01T13:51:02.176Z","etag":null,"topics":["vim"],"latest_commit_sha":null,"homepage":"https://junegunn.github.io/vim-plug/","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ASP-NET-MVC/aspnetwebstack","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/junegunn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"junegunn"}},"created_at":"2013-09-10T14:58:51.000Z","updated_at":"2025-05-01T12:49:02.000Z","dependencies_parsed_at":"2024-01-10T20:11:15.572Z","dependency_job_id":"bdcf2968-bb97-42ae-9c58-439833cb2cdd","html_url":"https://github.com/junegunn/vim-plug","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junegunn%2Fvim-plug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junegunn%2Fvim-plug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junegunn%2Fvim-plug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junegunn%2Fvim-plug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junegunn","download_url":"https://codeload.github.com/junegunn/vim-plug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253669774,"owners_count":21945154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["vim"],"created_at":"2024-07-31T01:00:49.470Z","updated_at":"2025-05-12T03:40:25.422Z","avatar_url":"https://github.com/junegunn.png","language":"Vim Script","readme":"\u003cdiv align=\"center\" markdown=\"1\"\u003e\n   \u003csup\u003eSpecial thanks to:\u003c/sup\u003e\n   \u003cbr\u003e\n   \u003cbr\u003e\n   \u003ca href=\"https://www.warp.dev/?utm_source=github\u0026utm_medium=referral\u0026utm_campaign=vim-plug\"\u003e\n      \u003cimg alt=\"Warp sponsorship\" width=\"400\" src=\"https://github.com/user-attachments/assets/ab8dd143-b0fd-4904-bdc5-dd7ecac94eae\"\u003e\n   \u003c/a\u003e\n\n### [Warp, the intelligent terminal for developers](https://www.warp.dev/?utm_source=github\u0026utm_medium=referral\u0026utm_campaign=vim-plug)\n[Available for MacOS, Linux, \u0026 Windows](https://www.warp.dev/?utm_source=github\u0026utm_medium=referral\u0026utm_campaign=vim-plug)\u003cbr\u003e\n\n\u003c/div\u003e\n\u003chr\u003e\n\u003ch1 title=\"vim-plug\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./plug-dark.png\"\u003e\n    \u003cimg src=\"./plug.png\" height=\"75\" alt=\"vim-plug\"\u003e\n  \u003c/picture\u003e\n  \u003ca href=\"https://github.com/junegunn/vim-plug/actions/workflows/test.yml?query=branch%3Amaster\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/junegunn/vim-plug/test.yml?branch=master\"\u003e\n  \u003c/a\u003e\n\u003c/h1\u003e\n\nA minimalist Vim plugin manager.\n\n\u003cimg src=\"https://raw.githubusercontent.com/junegunn/i/master/vim-plug/installer.gif\" height=\"450\"\u003e\n\n## Pros.\n\n- Minimalist design\n    - Just one file with no dependencies. Super easy to set up.\n    - Concise, intuitive syntax that you can learn within minutes. No boilerplate code required.\n    - No feature bloat\n- Extremely stable with flawless backward compatibility\n    - Works perfectly with all versions of Vim since 2006 and all versions of Neovim ever released\n- [Super-fast][40/4] parallel installation/update\n- Creates shallow clones to minimize disk space usage and download time\n- On-demand loading for [faster startup time][startup-time]\n- Can review and rollback updates\n- Branch/tag/commit support\n- Post-update hooks\n- Support for externally managed plugins\n\n[40/4]: https://raw.githubusercontent.com/junegunn/i/master/vim-plug/40-in-4.gif\n[startup-time]: https://github.com/junegunn/vim-startuptime-benchmark#result\n\n## Installation\n\n[Download plug.vim](https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim)\nand put it in the \"autoload\" directory.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to see the instructions\u003c/summary\u003e\n\n### Vim\n\n#### Unix\n\n```sh\ncurl -fLo ~/.vim/autoload/plug.vim --create-dirs \\\n    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim\n```\n\nYou can automate the process by putting the command in your Vim configuration\nfile as suggested [here][auto].\n\n[auto]: https://github.com/junegunn/vim-plug/wiki/tips#automatic-installation\n\n#### Windows (PowerShell)\n\n```powershell\niwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |`\n    ni $HOME/vimfiles/autoload/plug.vim -Force\n```\n\n### Neovim\n\n#### Unix, Linux\n\n```sh\nsh -c 'curl -fLo \"${XDG_DATA_HOME:-$HOME/.local/share}\"/nvim/site/autoload/plug.vim --create-dirs \\\n       https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'\n```\n\n#### Linux (Flatpak)\n\n```sh\ncurl -fLo ~/.var/app/io.neovim.nvim/data/nvim/site/autoload/plug.vim --create-dirs \\\n    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim\n```\n\n#### Windows (PowerShell)\n\n```powershell\niwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |`\n    ni \"$(@($env:XDG_DATA_HOME, $env:LOCALAPPDATA)[$null -eq $env:XDG_DATA_HOME])/nvim-data/site/autoload/plug.vim\" -Force\n```\n\n\u003c/details\u003e\n\n## Usage\n\nAdd a vim-plug section to your `~/.vimrc` (or `~/.config/nvim/init.vim` for Neovim)\n\n1. Begin the section with `call plug#begin()`\n1. List the plugins with `Plug` commands\n1. End the section with `call plug#end()`\n\nFor example,\n\n```vim\ncall plug#begin()\n\n\" List your plugins here\nPlug 'tpope/vim-sensible'\n\ncall plug#end()\n```\n\nReload the file or restart Vim, then you can,\n\n* `:PlugInstall` to install the plugins\n* `:PlugUpdate` to install or update the plugins\n* `:PlugDiff` to review the changes from the last update\n* `:PlugClean` to remove plugins no longer in the list\n\n\u003e [!NOTE]\n\u003e That's basically all you need to know to get started. The rest of the\n\u003e document is for advanced users who want to know more about the features and\n\u003e options.\n\n\u003e [!TIP]\n\u003e `plug#end()` automatically executes `filetype plugin indent on` and `syntax\n\u003e enable`. We believe this is a good default for most users, but if you don't\n\u003e want this behavior, you can revert the settings after the call.\n\u003e\n\u003e ```vim\n\u003e call plug#end()\n\u003e filetype indent off   \" Disable file-type-specific indentation\n\u003e syntax off            \" Disable syntax highlighting\n\u003e ```\n\n### Getting Help\n\n- See [tutorial] page to learn more about the basics of vim-plug\n- See [tips] and [FAQ] pages for common problems and questions\n\n[tutorial]: https://github.com/junegunn/vim-plug/wiki/tutorial\n[tips]: https://github.com/junegunn/vim-plug/wiki/tips\n[FAQ]: https://github.com/junegunn/vim-plug/wiki/faq\n\n## Examples\n\nThe following examples demonstrate the additional features of vim-plug.\n\n### Vim script example\n\n```vim\ncall plug#begin()\n\" The default plugin directory will be as follows:\n\"   - Vim (Linux/macOS): '~/.vim/plugged'\n\"   - Vim (Windows): '~/vimfiles/plugged'\n\"   - Neovim (Linux/macOS/Windows): stdpath('data') . '/plugged'\n\" You can specify a custom plugin directory by passing it as the argument\n\"   - e.g. `call plug#begin('~/.vim/plugged')`\n\"   - Avoid using standard Vim directory names like 'plugin'\n\n\" Make sure you use single quotes\n\n\" Shorthand notation for GitHub; translates to https://github.com/junegunn/seoul256.vim.git\nPlug 'junegunn/seoul256.vim'\n\n\" Any valid git URL is allowed\nPlug 'https://github.com/junegunn/vim-easy-align.git'\n\n\" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)\nPlug 'fatih/vim-go', { 'tag': '*' }\n\n\" Using a non-default branch\nPlug 'neoclide/coc.nvim', { 'branch': 'release' }\n\n\" Use 'dir' option to install plugin in a non-default directory\nPlug 'junegunn/fzf', { 'dir': '~/.fzf' }\n\n\" Post-update hook: run a shell command after installing or updating the plugin\nPlug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }\n\n\" Post-update hook can be a lambda expression\nPlug 'junegunn/fzf', { 'do': { -\u003e fzf#install() } }\n\n\" If the vim plugin is in a subdirectory, use 'rtp' option to specify its path\nPlug 'nsf/gocode', { 'rtp': 'vim' }\n\n\" On-demand loading: loaded when the specified command is executed\nPlug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' }\n\n\" On-demand loading: loaded when a file with a specific file type is opened\nPlug 'tpope/vim-fireplace', { 'for': 'clojure' }\n\n\" Unmanaged plugin (manually installed and updated)\nPlug '~/my-prototype-plugin'\n\n\" Call plug#end to update \u0026runtimepath and initialize the plugin system.\n\" - It automatically executes `filetype plugin indent on` and `syntax enable`\ncall plug#end()\n\" You can revert the settings after the call like so:\n\"   filetype indent off   \" Disable file-type-specific indentation\n\"   syntax off            \" Disable syntax highlighting\n\n\" Color schemes should be loaded after plug#end().\n\" We prepend it with 'silent!' to ignore errors when it's not yet installed.\nsilent! colorscheme seoul256\n```\n\n### Lua example for Neovim\n\nIn Neovim, you can write your configuration in a Lua script file named\n`init.lua`. The following code is the Lua script equivalent to the Vim script\nexample above.\n\n```lua\nlocal vim = vim\nlocal Plug = vim.fn['plug#']\n\nvim.call('plug#begin')\n\n-- Shorthand notation for GitHub; translates to https://github.com/junegunn/seoul256.vim.git\nPlug('junegunn/seoul256.vim')\n\n-- Any valid git URL is allowed\nPlug('https://github.com/junegunn/vim-easy-align.git')\n\n-- Using a tagged release; wildcard allowed (requires git 1.9.2 or above)\nPlug('fatih/vim-go', { ['tag'] = '*' })\n\n-- Using a non-default branch\nPlug('neoclide/coc.nvim', { ['branch'] = 'release' })\n\n-- Use 'dir' option to install plugin in a non-default directory\nPlug('junegunn/fzf', { ['dir'] = '~/.fzf' })\n\n-- Post-update hook: run a shell command after installing or updating the plugin\nPlug('junegunn/fzf', { ['dir'] = '~/.fzf', ['do'] = './install --all' })\n\n-- Post-update hook can be a lambda expression\nPlug('junegunn/fzf', { ['do'] = function()\n  vim.fn['fzf#install']()\nend })\n\n-- If the vim plugin is in a subdirectory, use 'rtp' option to specify its path\nPlug('nsf/gocode', { ['rtp'] = 'vim' })\n\n-- On-demand loading: loaded when the specified command is executed\nPlug('preservim/nerdtree', { ['on'] = 'NERDTreeToggle' })\n\n-- On-demand loading: loaded when a file with a specific file type is opened\nPlug('tpope/vim-fireplace', { ['for'] = 'clojure' })\n\n-- Unmanaged plugin (manually installed and updated)\nPlug('~/my-prototype-plugin')\n\nvim.call('plug#end')\n\n-- Color schemes should be loaded after plug#end().\n-- We prepend it with 'silent!' to ignore errors when it's not yet installed.\nvim.cmd('silent! colorscheme seoul256')\n```\n\n## Commands\n\n| Command                             | Description                                                        |\n| ----------------------------------- | ------------------------------------------------------------------ |\n| `PlugInstall [name ...] [#threads]` | Install plugins                                                    |\n| `PlugUpdate [name ...] [#threads]`  | Install or update plugins                                          |\n| `PlugClean[!]`                      | Remove unlisted plugins (bang version will clean without prompt)   |\n| `PlugUpgrade`                       | Upgrade vim-plug itself                                            |\n| `PlugStatus`                        | Check the status of plugins                                        |\n| `PlugDiff`                          | Examine changes from the previous update and the pending changes   |\n| `PlugSnapshot[!] [output path]`     | Generate script for restoring the current snapshot of the plugins  |\n\n## `Plug` options\n\n| Option                  | Description                                                 |\n| ----------------------- | ----------------------------------------------------------- |\n| `branch`/`tag`/`commit` | Branch/tag/commit of the repository to use                  |\n| `rtp`                   | Subdirectory that contains Vim plugin                       |\n| `dir`                   | Custom directory for the plugin                             |\n| `as`                    | Use different name for the plugin                           |\n| `do`                    | Post-update hook (string or funcref)                        |\n| `on`                    | On-demand loading: Commands or `\u003cPlug\u003e`-mappings            |\n| `for`                   | On-demand loading: File types                               |\n| `frozen`                | Do not remove and do not update unless explicitly specified |\n\n## Global options\n\n| Flag                | Default                           | Description                                            |\n| ------------------- | --------------------------------- | ------------------------------------------------------ |\n| `g:plug_threads`    | 16                                | Default number of threads to use                       |\n| `g:plug_timeout`    | 60                                | Time limit of each task in seconds (*Ruby \u0026 Python*)   |\n| `g:plug_retries`    | 2                                 | Number of retries in case of timeout (*Ruby \u0026 Python*) |\n| `g:plug_shallow`    | 1                                 | Use shallow clone                                      |\n| `g:plug_window`     | `-tabnew`                         | Command to open plug window                            |\n| `g:plug_pwindow`    | `vertical rightbelow new`         | Command to open preview window in `PlugDiff`           |\n| `g:plug_url_format` | `https://git::@github.com/%s.git` | `printf` format to build repo URL (Only applies to the subsequent `Plug` commands) |\n\n\n## Keybindings\n\n- `D` - `PlugDiff`\n- `S` - `PlugStatus`\n- `R` - Retry failed update or installation tasks\n- `U` - Update plugins in the selected range\n- `q` - Abort the running tasks or close the window\n- `:PlugStatus`\n    - `L` - Load plugin\n- `:PlugDiff`\n    - `X` - Revert the update\n\n## Post-update hooks\n\nThere are some plugins that require extra steps after installation or update.\nIn that case, use the `do` option to describe the task to be performed.\n\n```vim\nPlug 'Shougo/vimproc.vim', { 'do': 'make' }\nPlug 'ycm-core/YouCompleteMe', { 'do': './install.py' }\n```\n\nIf the value starts with `:`, it will be recognized as a Vim command.\n\n```vim\nPlug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }\n```\n\nTo call a Vim function, you can pass a lambda expression like so:\n\n```vim\nPlug 'junegunn/fzf', { 'do': { -\u003e fzf#install() } }\n```\n\nIf you need more control, you can pass a reference to a Vim function that\ntakes a dictionary argument.\n\n```vim\nfunction! BuildYCM(info)\n  \" info is a dictionary with 3 fields\n  \" - name:   name of the plugin\n  \" - status: 'installed', 'updated', or 'unchanged'\n  \" - force:  set on PlugInstall! or PlugUpdate!\n  if a:info.status == 'installed' || a:info.force\n    !./install.py\n  endif\nendfunction\n\nPlug 'ycm-core/YouCompleteMe', { 'do': function('BuildYCM') }\n```\n\nA post-update hook is executed inside the directory of the plugin and only run\nwhen the repository has changed, but you can force it to run unconditionally\nwith the bang-versions of the commands: `PlugInstall!` and `PlugUpdate!`.\n\n\u003e [!TIP]\n\u003e Make sure to escape BARs and double-quotes when you write the `do` option\n\u003e inline as they are mistakenly recognized as command separator or the start of\n\u003e the trailing comment.\n\u003e\n\u003e ```vim\n\u003e Plug 'junegunn/fzf', { 'do': 'yes \\| ./install' }\n\u003e ```\n\u003e\n\u003e But you can avoid the escaping if you extract the inline specification using a\n\u003e variable (or any Vim script expression) as follows:\n\u003e\n\u003e ```vim\n\u003e let g:fzf_install = 'yes | ./install'\n\u003e Plug 'junegunn/fzf', { 'do': g:fzf_install }\n\u003e ```\n\n### `PlugInstall!` and `PlugUpdate!`\n\nThe installer takes the following steps when installing/updating a plugin:\n\n1. `git clone` or `git fetch` from its origin\n2. Check out branch, tag, or commit and optionally `git merge` remote branch\n3. If the plugin was updated (or installed for the first time)\n    1. Update submodules\n    2. Execute post-update hooks\n\nThe commands with the `!` suffix ensure that all steps are run unconditionally.\n\n## On-demand loading of plugins\n\n```vim\n\" NERD tree will be loaded on the first invocation of NERDTreeToggle command\nPlug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' }\n\n\" Multiple commands\nPlug 'junegunn/vim-github-dashboard', { 'on': ['GHDashboard', 'GHActivity'] }\n\n\" Loaded when clojure file is opened\nPlug 'tpope/vim-fireplace', { 'for': 'clojure' }\n\n\" Multiple file types\nPlug 'kovisoft/paredit', { 'for': ['clojure', 'scheme'] }\n\n\" On-demand loading on both conditions\nPlug 'junegunn/vader.vim',  { 'on': 'Vader', 'for': 'vader' }\n\n\" Code to execute when the plugin is lazily loaded on demand\nPlug 'junegunn/goyo.vim', { 'for': 'markdown' }\nautocmd! User goyo.vim echom 'Goyo is now loaded!'\n```\n\n\u003e [!NOTE]\n\u003e #### Should I set up on-demand loading?\n\u003e\n\u003e You probably don't need to.\n\u003e\n\u003e A properly implemented Vim plugin should already load lazily without any\n\u003e help from a plugin manager (`:help autoload`). So there are few cases where\n\u003e these options actually make much sense. Making a plugin load faster is\n\u003e the responsibility of the plugin developer, not the user. If you find\n\u003e a plugin that takes too long to load, consider opening an issue on the\n\u003e plugin's issue tracker.\n\u003e\n\u003e Let me give you a perspective. The time it takes to load a plugin is usually\n\u003e less than 2 or 3ms on modern computers. So unless you use a very large\n\u003e number of plugins, you are unlikely to save more than 50ms. If you have\n\u003e spent an hour carefully setting up the options to shave off 50ms, you\n\u003e will have to start Vim 72,000 times just to break even. You should ask\n\u003e yourself if that's a good investment of your time.\n\u003e\n\u003e Make sure that you're tackling the right problem by breaking down the\n\u003e startup time of Vim using `--startuptime`.\n\u003e\n\u003e ```sh\n\u003e vim --startuptime /tmp/log\n\u003e ```\n\u003e\n\u003e On-demand loading should only be used as a last resort. It is basically\n\u003e a hacky workaround and is not always guaranteed to work.\n\n\u003e [!TIP]\n\u003e You can pass an empty list to `on` or `for` option to disable the loading\n\u003e of the plugin. You can manually load the plugin using `plug#load(NAMES...)`\n\u003e function.\n\u003e\n\u003e See https://github.com/junegunn/vim-plug/wiki/tips#loading-plugins-manually\n\n\n## Collaborators\n\n- [Jan Edmund Lazo](https://github.com/janlazo) - Windows support\n- [Jeremy Pallats](https://github.com/starcraftman) - Python installer\n\n## License\n\nMIT\n","funding_links":["https://github.com/sponsors/junegunn"],"categories":["Installation","HarmonyOS","What does it contain?","Vim Script","Vim script","Vim script (5)","VimL","Vim-Plugin","Plugins","\u003e 20K ⭐️",":rice_scene:  Setup","语言资源库","vim","Shell","Editors and IDE","tools","Plugin Management","Table of Contents"],"sub_categories":["Windows Manager","Plugin Manager","User configuration","shell","Apt-Installll","Editors","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunegunn%2Fvim-plug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunegunn%2Fvim-plug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunegunn%2Fvim-plug/lists"}