1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 15:19:12 +08:00

Add command SPClean to claer unused plugins (#3589)

close #3588
This commit is contained in:
Wang Shidong 2020-06-26 12:10:41 +08:00 committed by GitHub
parent 195a18e6b9
commit b62fd63ed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,6 +56,7 @@ function! SpaceVim#commands#load() abort
""
" Command for install plugins.
command! -nargs=* SPInstall call SpaceVim#commands#install_plugin(<f-args>)
command! -nargs=* SPClean call SpaceVim#commands#clean_plugin()
command! -nargs=0 Report call SpaceVim#issue#new()
endfunction
@ -126,6 +127,17 @@ function! SpaceVim#commands#reinstall_plugin(...) abort
endif
endfunction
function! SpaceVim#commands#clean_plugin() abort
if g:spacevim_plugin_manager ==# 'dein'
call map(dein#check_clean(), "delete(v:val, 'rf')")
call dein#recache_runtimepath()
elseif g:spacevim_plugin_manager ==# 'neobundle'
" @todo add SPClean support for neobundle
elseif g:spacevim_plugin_manager ==# 'vim-plug'
" @todo add SPClean support for vim-plug
endif
endfunction
function! SpaceVim#commands#install_plugin(...) abort
if g:spacevim_plugin_manager ==# 'neobundle'
if a:0 == 0