{"id":25891067,"url":"https://github.com/wsdjeg/nvim-plug","last_synced_at":"2025-04-23T13:56:45.082Z","repository":{"id":278587305,"uuid":"926948796","full_name":"wsdjeg/nvim-plug","owner":"wsdjeg","description":"simple neovim plugin manager written in Lua","archived":false,"fork":false,"pushed_at":"2025-04-12T07:53:20.000Z","size":91,"stargazers_count":11,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T08:37:32.495Z","etag":null,"topics":["neovim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wsdjeg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2025-02-04T06:14:02.000Z","updated_at":"2025-04-12T07:53:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb3b98dd-9029-49a6-bc2d-58862e454a4b","html_url":"https://github.com/wsdjeg/nvim-plug","commit_stats":null,"previous_names":["wsdjeg/nvim-plug"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wsdjeg%2Fnvim-plug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wsdjeg%2Fnvim-plug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wsdjeg%2Fnvim-plug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wsdjeg%2Fnvim-plug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wsdjeg","download_url":"https://codeload.github.com/wsdjeg/nvim-plug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250444727,"owners_count":21431703,"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":["neovim-plugin"],"created_at":"2025-03-02T20:01:35.473Z","updated_at":"2025-04-23T13:56:45.076Z","avatar_url":"https://github.com/wsdjeg.png","language":"Lua","readme":"# nvim-plug\n\n[![](https://spacevim.org/img/build-with-SpaceVim.svg)](https://spacevim.org)\n[![GPLv3 License](https://img.spacevim.org/license-GPLv3-blue.svg)](LICENSE)\n\n![nvim-plug](https://wsdjeg.net/images/nvim-plug.gif)\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [Intro](#intro)\n* [Features](#features)\n* [Usage](#usage)\n    * [Installation](#installation)\n    * [Setup nvim-plug](#setup-nvim-plug)\n    * [Add plugins](#add-plugins)\n    * [Self upgrade](#self-upgrade)\n* [Plugin Spec](#plugin-spec)\n* [Commands](#commands)\n* [Default UI](#default-ui)\n* [Notify UI](#notify-ui)\n* [Custom Plugin UI](#custom-plugin-ui)\n* [Plugin priority](#plugin-priority)\n* [Self-Promotion](#self-promotion)\n* [Feedback](#feedback)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n## Intro\n\nnvim-plug is an asynchronous Neovim plugin manager written in Lua.\nThere is also a [Chinese introduction](https://wsdjeg.net/neovim-plugin-manager-nvim-plug/) about this plugin.\n\n## Features\n\n- **faster:** written in lua.\n- **async:** downloading and building via job.\n- **lazy loading:** lazy load plugin based on events, comamnd, mapping, etc..\n- **custom UI:** provide custom UI API.\n\n## Usage\n\n### Installation\n\nClone this repository.\n\n```\ngit clone https://github.com/wsdjeg/nvim-plug.git D:/bundle_dir/wsdjeg/nvim-plug\n```\n\nand append the path of this repository to your neovim neovim runtimepath option:\n\ninit.lua\n\n```lua\nvim.opt.runtimepath:append('D:/bundle_dir/wsdjeg/nvim-plug')\n```\n\nTo install nvim-plug automatically:\n\n```lua\nif vim.fn.isdirectory('D:/bundle_dir/wsdjeg/nvim-plug') == 0 then\n  vim.fn.system({\n    'git',\n    'clone',\n    '--depth',\n    '1',\n    'https://github.com/wsdjeg/nvim-plug.git',\n    'D:/bundle_dir/wsdjeg/nvim-plug',\n  })\nend\nvim.opt.runtimepath:append('D:/bundle_dir/wsdjeg/nvim-plug')\n```\n\n### Setup nvim-plug\n\n```lua\nrequire('plug').setup({\n  -- set the bundle dir\n  bundle_dir = 'D:/bundle_dir',\n  -- set the path where raw plugin is download to\n  raw_plugin_dir = 'D:/bundle_dir/raw_plugin',\n  -- max number of processes used for nvim-plug job\n  max_processes = 5,\n  base_url = 'https://github.com',\n  -- default ui is `default`,\n  -- to use `notify` for floating window notify\n  -- you need to install wsdjeg/notify.nvim\n  ui = 'default',\n  -- default is nil\n  http_proxy = 'http://127.0.0.1:7890',\n  -- default is nil\n  https_proxy = 'http://127.0.0.1:7890',\n  -- default history depth for `git clone`\n  clone_depth = 1,\n  -- plugin priority, readme [plugin priority] for more info\n  enable_priority = false\n})\n```\n\n### Add plugins\n\n```lua\nrequire('plug').add({\n  {\n    'wsdjeg/scrollbar.vim',\n    events = { 'VimEnter' },\n  },\n  {\n    'wsdjeg/vim-chat',\n    enabled = function()\n      return vim.fn.has('nvim-0.10.0') == 1\n    end,\n  },\n  {\n    'wsdjeg/flygrep.nvim',\n    cmds = { 'FlyGrep' },\n    config = function()\n      require('flygrep').setup()\n    end,\n  },\n  {\n    type = 'raw',\n    url = 'https://gist.githubusercontent.com/wsdjeg/4ac99019c5ca156d35704550648ba321/raw/4e8c202c74e98b5d56616c784bfbf9b873dc8868/markdown.vim',\n    script_type = 'after/syntax'\n  },\n  {\n    'D:/wsdjeg/winbar.nvim',\n    events = { 'VimEnter' },\n  },\n  {\n    'wsdjeg/vim-mail',\n    on_func = 'mail#',\n  },\n})\n```\n\n### Self upgrade\n\nyou can use nvim-plug to manager nvim-plug:\n\n```lua\nif vim.fn.isdirectory('D:/bundle_dir/wsdjeg/nvim-plug') == 0 then\n  vim.fn.system({\n    'git',\n    'clone',\n    '--depth',\n    '1',\n    'https://github.com/wsdjeg/nvim-plug.git',\n    'D:/bundle_dir/wsdjeg/nvim-plug',\n  })\nend\nvim.opt.runtimepath:append('D:/bundle_dir/wsdjeg/nvim-plug')\nrequire('plug').setup({\n  -- set the bundle dir\n  bundle_dir = 'D:/bundle_dir',\n})\nrequire('plug').add({\n  {\n    'wsdjeg/nvim-plug',\n    fetch = true,\n  },\n})\n```\n\n## Plugin Spec\n\nThe plugin spec is inspired by [dein.nvim](https://github.com/Shougo/dein.vim).\n\n| name            | description                                                                                                      |\n| --------------- | ---------------------------------------------------------------------------------------------------------------- |\n| `[1]`           | `string`, plugin repo short name, `wsdjeg/flygrep.nvim`                                                          |\n| `cmds`          | `string` or `table\u003cstring\u003e`, commands lazy loading                                                               |\n| `events`        | `string` or `table\u003cstring\u003e`, events lazy loading                                                                 |\n| `config`        | `function`, function called after adding plugin path to nvim rtp, before loading files in `plugin/` directory    |\n| `config_after`  | `function`, function called after loading files in `plugin/` directory                                           |\n| `config_before` | `function`, function called when `plug.add()` function is called                                                 |\n| `on_ft`         | `string` or `table\u003cstring\u003e`, filetypes lazy loading                                                              |\n| `on_map`        | `string` or `table\u003cstring\u003e`, key bindings lazy loading                                                           |\n| `on_func`       | `string` or `table\u003cstring\u003e`, vim function lazy loading                                                           |\n| `script_type`   | `string`, plugin type including `color`, `plugin`, etc..                                                         |\n| `build`         | `string` or `table\u003cstring\u003e`, executed by [job](https://spacevim.org/api/job/) api                                |\n| `enabled`       | `boolean` or `function` evaluated when startup, when it is false, plugin will be skiped                          |\n| `frozen`        | update only when specific with `PlugUpdate name`                                                                 |\n| `depends`       | `table\u003cPluginSpec\u003e` a list of plugins                                                                            |\n| `branch`        | `string` specific git branch                                                                                     |\n| `tag`           | `string` specific git tag                                                                                        |\n| `type`          | `string` specific plugin type, this can be git, raw or none, if it is raw, `script_type` must be set             |\n| `autoload`      | `boolean`, load plugin after git clone                                                                           |\n| `priority`      | `number`, default is 50, set the order in which plugins are loaded                                               |\n| `fetch`         | If set to true, nvim-plug doesn't add the path to user runtimepath. It is useful to manager no-plugin repository |\n\n- `config` and `config_after` function will be not be called if the plugin has not been installed.\n- `priority` does not work for lazy plugins.\n\n## Commands\n\n- `:PlugInstall`: install specific plugin or all plugins\n- `:PlugUpdate`: update specific plugin or all plugins\n\n## Default UI\n\nThe default is ui is inspired by [vundle](https://github.com/VundleVim/Vundle.vim)\n\nThe default highlight group.\n\n| highlight group name | default link | description                     |\n| -------------------- | ------------ | ------------------------------- |\n| `PlugTitle`          | `TODO`       | the first line of plugin window |\n| `PlugProcess`        | `Repeat`     | the process of downloading      |\n| `PlugDone`           | `Type`       | clone/build/install done        |\n| `PlugFailed`         | `WarningMsg` | clone/build/install failed      |\n| `PlugDoing`          | `Number`     | job is running                  |\n\nTo change the default highlight group:\n\n```lua\nvim.cmd('hi def link PlugTitle TODO')\nvim.cmd('hi def link PlugProcess Repeat')\nvim.cmd('hi def link PlugDone Type')\nvim.cmd('hi def link PlugFailed WarningMsg')\nvim.cmd('hi def link PlugDoing Number')\n```\n\n## Notify UI\n\nYou can also change the ui to `notify`:\n\n![plug-notify](https://github.com/user-attachments/assets/74c16409-02e9-4042-9874-17e656e4295a)\n\nThis UI is based on [notify.nvim](https://github.com/wsdjeg/notify.nvim). So you need to install it before using nvim-plug:\n\n```lua\nif vim.fn.isdirectory('D:/bundle_dir/wsdjeg/nvim-plug') == 0 then\n  vim.fn.system({\n    'git',\n    'clone',\n    '--depth',\n    '1',\n    'https://github.com/wsdjeg/nvim-plug.git',\n    'D:/bundle_dir/wsdjeg/nvim-plug',\n  })\nend\nvim.opt.runtimepath:append('D:/bundle_dir/wsdjeg/nvim-plug')\nif vim.fn.isdirectory('D:/bundle_dir/wsdjeg/notify.nvim') == 0 then\n  vim.fn.system({\n    'git',\n    'clone',\n    '--depth',\n    '1',\n    'https://github.com/wsdjeg/notify.nvim.git',\n    'D:/bundle_dir/wsdjeg/notify.nvim',\n  })\nend\nvim.opt.runtimepath:append('D:/bundle_dir/wsdjeg/notify.nvim')\n\nrequire('plug').setup({\n\n  bundle_dir = 'D:/bundle_dir',\n  raw_plugin_dir = 'D:/bundle_dir/raw_plugin',\n  ui = 'notify',\n  http_proxy = 'http://127.0.0.1:7890',\n  https_proxy = 'http://127.0.0.1:7890',\n  enable_priority = true,\n  max_processes = 16,\n})\n\nrequire('plug').add({\n  {\n    'wsdjeg/logger.nvim',\n    config = function()\n      require('logger').setup({ level = 0 })\n      vim.keymap.set(\n        'n',\n        '\u003cleader\u003ehL',\n        '\u003ccmd\u003elua require(\"logger\").viewRuntimeLog()\u003ccr\u003e',\n        { silent = true }\n      )\n    end,\n  },\n  {\n    'wsdjeg/notify.nvim',\n    fetch = true,\n  },\n  {\n    'wsdjeg/nvim-plug',\n    fetch = true,\n  },\n})\n```\n\n## Custom Plugin UI\n\nTo setup custom UI, you need to creat a on_update function, this function is called with two arges, `name` and `plugUiData`.\n\nThe plugUiData is table with following keys:\n\n| key             | description                                          |\n| --------------- | ---------------------------------------------------- |\n| `clone_done`    | boolead, is true when clone successfully             |\n| `command`       | string, clone, pull, curl or build                   |\n| `clone_process` | string, git clone progress, such as `16% (160/1000)` |\n| `clone_done`    | boolean, git clone exit status                       |\n| `building`      | boolean                                              |\n| `build_done`    | boolean                                              |\n| `pull_done`     | boolean                                              |\n| `pull_process`  | string                                               |\n| `curl_done`     | boolean                                              |\n\n```lua\n--- your custom UI\n\nlocal function on_ui_update(name, data)\n  -- logic\nend\n\n\nrequire('plug').setup({\n  bundle_dir = 'D:/bundle_dir',\n  max_processes = 5, -- max number of processes used for nvim-plug job\n  base_url = 'https://github.com',\n  ui = on_ui_update, -- default ui is notify, use `default` for split window UI\n})\n```\n\n## Plugin priority\n\nBy default this feature is disabled, plugins will be loaded when run `add({plugins})` function.\nTo enable plugin priority feature, you need to call `plug.load()` after `plug.add()` function.\nThis option is not for lazy plugins.\n\nfor example:\n\n```lua\nrequire('plug').setup({\n  max_processes = 5,\n  enable_priority = true,\n})\nrequire('plug').add({\n  {\n    'wsdjeg/scrollbar.vim',\n    events = { 'VimEnter' },\n  },\n  {\n    'wsdjeg/vim-chat',\n    enabled = function()\n      return vim.fn.has('nvim-0.10.0') == 1\n    end,\n  },\n  {\n    'wsdjeg/flygrep.nvim',\n    cmds = { 'FlyGrep' },\n    config = function()\n      require('flygrep').setup()\n    end,\n  },\n  {\n    'rakr/vim-one',\n    config = function()\n      vim.cmd('colorscheme one')\n    end,\n    priority = 100,\n  },\n})\nrequire('plug').load()\n```\n\n## Self-Promotion\n\nLike this plugin? Star the repository on\nGitHub.\n\nLove this plugin? Follow [me](https://wsdjeg.net/) on\n[GitHub](https://github.com/wsdjeg) and\n[Twitter](http://twitter.com/wsdtty).\n\n\n## Feedback\n\nIf you encounter any bugs or have suggestions, please file an issue in the [issue tracker](https://github.com/wsdjeg/nvim-plug/issues).\n","funding_links":[],"categories":["Plugin Manager","Lua"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwsdjeg%2Fnvim-plug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwsdjeg%2Fnvim-plug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwsdjeg%2Fnvim-plug/lists"}