mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 13:10:04 +08:00
Add SPUpdate command
This commit is contained in:
parent
3fa447f706
commit
33cf405549
@ -26,8 +26,21 @@ function! SpaceVim#commands#load() abort
|
||||
command! -nargs=*
|
||||
\ -complete=customlist,SpaceVim#commands#complete_SPConfig
|
||||
\ SPConfig call SpaceVim#commands#config(<f-args>)
|
||||
command! -nargs=*
|
||||
\ -complete=custom,SpaceVim#commands#complete_plugin
|
||||
\ SPUpdate call SpaceVim#commands#update_plugin(<f-args>)
|
||||
endfunction
|
||||
|
||||
" @vimlint(EVL103, 1, a:ArgLead)
|
||||
" @vimlint(EVL103, 1, a:CmdLine)
|
||||
" @vimlint(EVL103, 1, a:CursorPos)
|
||||
function! SpaceVim#commands#complete_plugin(ArgLead, CmdLine, CursorPos) abort
|
||||
return join(g:_spacevim_plugins, "\n")
|
||||
endfunction
|
||||
" @vimlint(EVL103, 0, a:ArgLead)
|
||||
" @vimlint(EVL103, 0, a:CmdLine)
|
||||
" @vimlint(EVL103, 0, a:CursorPos)
|
||||
|
||||
" @vimlint(EVL103, 1, a:ArgLead)
|
||||
" @vimlint(EVL103, 1, a:CmdLine)
|
||||
" @vimlint(EVL103, 1, a:CursorPos)
|
||||
@ -46,6 +59,14 @@ function! SpaceVim#commands#config(...) abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#commands#update_plugin(plug) abort
|
||||
if g:spacevim_plugin_manager ==# 'neobundle'
|
||||
elseif g:spacevim_plugin_manager ==# 'dein'
|
||||
call dein#update([a:plug])
|
||||
elseif g:spacevim_plugin_manager ==# 'vim-plug'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
function! SpaceVim#commands#version() abort
|
||||
echo 'SpaceVim ' . g:spacevim_version . '-' . s:SHA() . "\n" .
|
||||
|
@ -148,7 +148,7 @@ let s:plugins = []
|
||||
fu! s:parser(args) abort
|
||||
return a:args
|
||||
endf
|
||||
|
||||
let g:_spacevim_plugins = []
|
||||
function! zvim#plug#add(repo,...) abort
|
||||
let g:spacevim_plugin_name = ''
|
||||
if g:spacevim_plugin_manager ==# 'neobundle'
|
||||
@ -161,6 +161,7 @@ function! zvim#plug#add(repo,...) abort
|
||||
call dein#add(a:repo)
|
||||
endif
|
||||
let g:spacevim_plugin_name = g:dein#name
|
||||
call add(g:_spacevim_plugins, g:dein#name)
|
||||
elseif g:spacevim_plugin_manager ==# 'vim-plug'
|
||||
if len(a:000) > 0
|
||||
exec "Plug '".a:repo."', ".join(a:000,',')
|
||||
|
Loading…
Reference in New Issue
Block a user