1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:50:04 +08:00

Add SPUpdate command

This commit is contained in:
wsdjeg 2017-04-03 16:42:09 +08:00
parent 3fa447f706
commit 33cf405549
2 changed files with 23 additions and 1 deletions

View File

@ -26,8 +26,21 @@ function! SpaceVim#commands#load() abort
command! -nargs=* command! -nargs=*
\ -complete=customlist,SpaceVim#commands#complete_SPConfig \ -complete=customlist,SpaceVim#commands#complete_SPConfig
\ SPConfig call SpaceVim#commands#config(<f-args>) \ SPConfig call SpaceVim#commands#config(<f-args>)
command! -nargs=*
\ -complete=custom,SpaceVim#commands#complete_plugin
\ SPUpdate call SpaceVim#commands#update_plugin(<f-args>)
endfunction 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:ArgLead)
" @vimlint(EVL103, 1, a:CmdLine) " @vimlint(EVL103, 1, a:CmdLine)
" @vimlint(EVL103, 1, a:CursorPos) " @vimlint(EVL103, 1, a:CursorPos)
@ -46,6 +59,14 @@ function! SpaceVim#commands#config(...) abort
endif endif
endfunction 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 function! SpaceVim#commands#version() abort
echo 'SpaceVim ' . g:spacevim_version . '-' . s:SHA() . "\n" . echo 'SpaceVim ' . g:spacevim_version . '-' . s:SHA() . "\n" .

View File

@ -148,7 +148,7 @@ let s:plugins = []
fu! s:parser(args) abort fu! s:parser(args) abort
return a:args return a:args
endf endf
let g:_spacevim_plugins = []
function! zvim#plug#add(repo,...) abort function! zvim#plug#add(repo,...) abort
let g:spacevim_plugin_name = '' let g:spacevim_plugin_name = ''
if g:spacevim_plugin_manager ==# 'neobundle' if g:spacevim_plugin_manager ==# 'neobundle'
@ -161,6 +161,7 @@ function! zvim#plug#add(repo,...) abort
call dein#add(a:repo) call dein#add(a:repo)
endif endif
let g:spacevim_plugin_name = g:dein#name let g:spacevim_plugin_name = g:dein#name
call add(g:_spacevim_plugins, g:dein#name)
elseif g:spacevim_plugin_manager ==# 'vim-plug' elseif g:spacevim_plugin_manager ==# 'vim-plug'
if len(a:000) > 0 if len(a:000) > 0
exec "Plug '".a:repo."', ".join(a:000,',') exec "Plug '".a:repo."', ".join(a:000,',')