mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-14 06:18:00 +08:00
feat(nvim-plug): load plugin after installation
This commit is contained in:
parent
202ea3637c
commit
812d72d057
3
bundle/nvim-plug/README.md
vendored
3
bundle/nvim-plug/README.md
vendored
@ -118,6 +118,9 @@ The plugin spec is inspired by dein.nvim.
|
|||||||
| `branch` | `string` specific git branch |
|
| `branch` | `string` specific git branch |
|
||||||
| `tag` | `string` specific git tag |
|
| `tag` | `string` specific git tag |
|
||||||
| `type` | `string` specific plugin type, this can be git, raw or none, if it is raw, `script_type` must be set |
|
| `type` | `string` specific plugin type, this can be git, raw or none, if it is raw, `script_type` must be set |
|
||||||
|
| `autoload` | `boolean`, load plugin after git clone |
|
||||||
|
|
||||||
|
`config` and `config_after` function will be not be called if the plugin has not been installed.
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
|
3
bundle/nvim-plug/lua/plug/installer.lua
vendored
3
bundle/nvim-plug/lua/plug/installer.lua
vendored
@ -13,6 +13,7 @@ local job = require('spacevim.api.job')
|
|||||||
local notify = require('spacevim.api.notify')
|
local notify = require('spacevim.api.notify')
|
||||||
local jobs = {}
|
local jobs = {}
|
||||||
local config = require('plug.config')
|
local config = require('plug.config')
|
||||||
|
local loader = require('plug.loader')
|
||||||
|
|
||||||
local on_uidate
|
local on_uidate
|
||||||
|
|
||||||
@ -155,6 +156,8 @@ function H.install_plugin(plugSpec)
|
|||||||
on_uidate(plugSpec.name, { clone_done = true, download_process = 100 })
|
on_uidate(plugSpec.name, { clone_done = true, download_process = 100 })
|
||||||
if plugSpec.build then
|
if plugSpec.build then
|
||||||
H.build(plugSpec)
|
H.build(plugSpec)
|
||||||
|
elseif plugSpec.autoload then
|
||||||
|
loader.load(plugSpec)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
on_uidate(plugSpec.name, { clone_done = false, download_process = 0 })
|
on_uidate(plugSpec.name, { clone_done = false, download_process = 0 })
|
||||||
|
1
bundle/nvim-plug/lua/plug/loader.lua
vendored
1
bundle/nvim-plug/lua/plug/loader.lua
vendored
@ -30,6 +30,7 @@ local add_raw_rtp = false
|
|||||||
--- @field config_before function function called after update rtp
|
--- @field config_before function function called after update rtp
|
||||||
--- @field config_after function function called after update rtp
|
--- @field config_after function function called after update rtp
|
||||||
--- @field hook_install_done? function
|
--- @field hook_install_done? function
|
||||||
|
--- @field autoload? boolean
|
||||||
|
|
||||||
--- @param plugSpec PluginSpec
|
--- @param plugSpec PluginSpec
|
||||||
--- @return boolean
|
--- @return boolean
|
||||||
|
7
bundle/nvim-plug/test/init.lua
vendored
7
bundle/nvim-plug/test/init.lua
vendored
@ -51,6 +51,13 @@ require('plug').add({
|
|||||||
events = { 'VimEnter' },
|
events = { 'VimEnter' },
|
||||||
config = function() end,
|
config = function() end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'rakr/vim-one',
|
||||||
|
events = { 'VimEnter' },
|
||||||
|
config = function()
|
||||||
|
vim.cmd('colorscheme one')
|
||||||
|
end,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'wsdjeg/flygrep.nvim',
|
'wsdjeg/flygrep.nvim',
|
||||||
cmds = { 'FlyGrep' },
|
cmds = { 'FlyGrep' },
|
||||||
|
Loading…
Reference in New Issue
Block a user