From 4695d33262e093bd4d20164c4d78a901f876cb34 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Wed, 5 Apr 2017 21:27:08 +0800 Subject: [PATCH] Update command for updating plugins --- autoload/SpaceVim/commands.vim | 11 ++++++++--- autoload/SpaceVim/plugins/manager.vim | 3 +++ doc/SpaceVim.txt | 3 ++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/autoload/SpaceVim/commands.vim b/autoload/SpaceVim/commands.vim index 84c05804d..45f98f9a7 100644 --- a/autoload/SpaceVim/commands.vim +++ b/autoload/SpaceVim/commands.vim @@ -27,7 +27,8 @@ function! SpaceVim#commands#load() abort \ -complete=customlist,SpaceVim#commands#complete_SPConfig \ SPConfig call SpaceVim#commands#config() "" - " Command for update plugin, support completion of plugin name. + " Command for update plugin, support completion of plugin name. If run + " without argv, All the plugin will be updated. " > " :SPUpdate vim-airline " < @@ -64,10 +65,14 @@ function! SpaceVim#commands#config(...) abort endif endfunction -function! SpaceVim#commands#update_plugin(plug) abort +function! SpaceVim#commands#update_plugin(...) abort if g:spacevim_plugin_manager ==# 'neobundle' elseif g:spacevim_plugin_manager ==# 'dein' - call dein#update([a:plug]) + if a:0 == 0 + call SpaceVim#plugins#manager#update() + else + call dein#update(a:000) + endif elseif g:spacevim_plugin_manager ==# 'vim-plug' endif endfunction diff --git a/autoload/SpaceVim/plugins/manager.vim b/autoload/SpaceVim/plugins/manager.vim index b23e8c96e..12ee2d040 100644 --- a/autoload/SpaceVim/plugins/manager.vim +++ b/autoload/SpaceVim/plugins/manager.vim @@ -156,6 +156,9 @@ function! s:on_pull_exit(id, data, event) abort if empty(s:pulling_repos) " TODO add elapsed time info. call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updated. Elapsed time:') + if g:spacevim_plugin_manager ==# 'dein' + call dein#recache_runtimepath() + endif endif endfunction diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index d56d9c0ea..de67e46ec 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -338,7 +338,8 @@ COMMANDS *SpaceVim-commands* < :SPUpdate *:SPUpdate* - Command for update plugin, support completion of plugin name. + Command for update plugin, support completion of plugin name. If run without + argv, All the plugin will be updated. > :SPUpdate vim-airline <