mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-26 12:10:32 +08:00
Update manager
This commit is contained in:
parent
051acf57ff
commit
86b23c9a64
@ -1,6 +1,7 @@
|
|||||||
function! SpaceVim#api#vim#compatible#get() abort
|
function! SpaceVim#api#vim#compatible#get() abort
|
||||||
return map({
|
return map({
|
||||||
\ 'execute' : '',
|
\ 'execute' : '',
|
||||||
|
\ 'system' : '',
|
||||||
\ },
|
\ },
|
||||||
\ "function('s:' . v:key)"
|
\ "function('s:' . v:key)"
|
||||||
\ )
|
\ )
|
||||||
@ -24,4 +25,20 @@ function! s:execute(cmd, ...) abort
|
|||||||
return output
|
return output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
if has('nvim')
|
||||||
|
function! s:system(cmd, ...) abort
|
||||||
|
return a:0 == 0 ? system(a:cmd) : system(a:cmd, a:1)
|
||||||
|
endfunction
|
||||||
|
else
|
||||||
|
function! s:system(cmd, ...) abort
|
||||||
|
if type(a:cmd) == 3
|
||||||
|
let cmd = map(a:cmd, 'shellescape(v:val)')
|
||||||
|
let cmd = join(cmd, ' ')
|
||||||
|
return a:0 == 0 ? system(cmd) : system(cmd, a:1)
|
||||||
|
else
|
||||||
|
return a:0 == 0 ? system(a:cmd) : system(a:cmd, a:1)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
|
|
||||||
" vim:set et sw=2 cc=80:
|
" vim:set et sw=2 cc=80:
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
|
" Load SpaceVim api
|
||||||
|
let s:VIM_CO = SpaceVim#api#import('vim#compatible')
|
||||||
" install plugin manager
|
" install plugin manager
|
||||||
function! s:install_manager() abort
|
function! s:install_manager() abort
|
||||||
" Fsep && Psep
|
" Fsep && Psep
|
||||||
@ -23,18 +25,14 @@ function! s:install_manager() abort
|
|||||||
\ . 'neobundle.vim'. s:Fsep. 'README.md')
|
\ . 'neobundle.vim'. s:Fsep. 'README.md')
|
||||||
let g:spacevim_neobundle_installed = 1
|
let g:spacevim_neobundle_installed = 1
|
||||||
else
|
else
|
||||||
if executable('git')
|
if s:need_cmd('git')
|
||||||
exec '!git clone '
|
call s:VIM_CO.system([
|
||||||
\ .'https://github.com/'
|
\ 'git',
|
||||||
\ .'Shougo/neobundle.vim'
|
\ 'clone',
|
||||||
\ . ' '
|
\ 'https://github.com/Shougo/neobundle.vim',
|
||||||
\ . fnameescape(g:spacevim_plugin_bundle_dir)
|
\ expand(g:spacevim_plugin_bundle_dir) . 'neobundle.vim'
|
||||||
\ . 'neobundle.vim'
|
\ ])
|
||||||
let g:spacevim_neobundle_installed = 1
|
let g:spacevim_neobundle_installed = 1
|
||||||
else
|
|
||||||
echohl WarningMsg
|
|
||||||
echom 'You need install git!'
|
|
||||||
echohl None
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
exec 'set runtimepath+='
|
exec 'set runtimepath+='
|
||||||
@ -48,16 +46,16 @@ function! s:install_manager() abort
|
|||||||
\ s:Fsep))
|
\ s:Fsep))
|
||||||
let g:spacevim_dein_installed = 1
|
let g:spacevim_dein_installed = 1
|
||||||
else
|
else
|
||||||
if executable('git')
|
if s:need_cmd('git')
|
||||||
exec '!git clone https://github.com/Shougo/dein.vim "'
|
call s:VIM_CO.system([
|
||||||
\ . expand(g:spacevim_plugin_bundle_dir)
|
\ 'git',
|
||||||
|
\ 'clone',
|
||||||
|
\ 'https://github.com/Shougo/dein.vim',
|
||||||
|
\ expand(g:spacevim_plugin_bundle_dir)
|
||||||
\ . join(['repos', 'github.com',
|
\ . join(['repos', 'github.com',
|
||||||
\ 'Shougo', 'dein.vim"'], s:Fsep)
|
\ 'Shougo', 'dein.vim"'], s:Fsep)
|
||||||
|
\ ])
|
||||||
let g:spacevim_dein_installed = 1
|
let g:spacevim_dein_installed = 1
|
||||||
else
|
|
||||||
echohl WarningMsg
|
|
||||||
echom 'You need install git!'
|
|
||||||
echohl None
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
exec 'set runtimepath+='. fnameescape(g:spacevim_plugin_bundle_dir)
|
exec 'set runtimepath+='. fnameescape(g:spacevim_plugin_bundle_dir)
|
||||||
@ -84,3 +82,14 @@ function! s:install_manager() abort
|
|||||||
exec 'set runtimepath+=~/.cache/vim-plug/'
|
exec 'set runtimepath+=~/.cache/vim-plug/'
|
||||||
endif
|
endif
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
function! s:need_cmd(cmd) abort
|
||||||
|
if executable(a:cmd)
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
echohl WarningMsg
|
||||||
|
echom '[SpaceVim] [plugin manager] You need install ' . a:cmd . '!'
|
||||||
|
echohl None
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user