mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-23 17:49:57 +08:00
parent
0c12b784a0
commit
a41d4a0ae1
@ -482,9 +482,14 @@ let g:spacevim_simple_mode = 0
|
|||||||
" The default file manager of SpaceVim. Default is 'vimfiler'.
|
" The default file manager of SpaceVim. Default is 'vimfiler'.
|
||||||
let g:spacevim_filemanager = 'vimfiler'
|
let g:spacevim_filemanager = 'vimfiler'
|
||||||
""
|
""
|
||||||
" The default plugin manager of SpaceVim. Default is 'dein'.
|
" The default plugin manager of SpaceVim.
|
||||||
|
" if has patch 7.4.2071, the default value is dein. Otherwise it is neobundle.
|
||||||
" Options are dein, neobundle, or vim-plug.
|
" Options are dein, neobundle, or vim-plug.
|
||||||
let g:spacevim_plugin_manager = 'dein'
|
if has('patch-7.4.2071')
|
||||||
|
let g:spacevim_plugin_manager = 'dein'
|
||||||
|
else
|
||||||
|
let g:spacevim_plugin_manager = 'neobundle'
|
||||||
|
endif
|
||||||
|
|
||||||
""
|
""
|
||||||
" @section plugin_manager_processes, options-plugin_manager_processes
|
" @section plugin_manager_processes, options-plugin_manager_processes
|
||||||
|
@ -63,7 +63,11 @@ endfunction
|
|||||||
" @vimlint(EVL103, 1, a:CmdLine)
|
" @vimlint(EVL103, 1, a:CmdLine)
|
||||||
" @vimlint(EVL103, 1, a:CursorPos)
|
" @vimlint(EVL103, 1, a:CursorPos)
|
||||||
function! SpaceVim#commands#complete_plugin(ArgLead, CmdLine, CursorPos) abort
|
function! SpaceVim#commands#complete_plugin(ArgLead, CmdLine, CursorPos) abort
|
||||||
return join(keys(dein#get()) + ['SpaceVim'], "\n")
|
if g:spacevim_plugin_manager ==# 'dein'
|
||||||
|
return join(keys(dein#get()) + ['SpaceVim'], "\n")
|
||||||
|
elseif g:spacevim_plugin_manager ==# 'neobundle'
|
||||||
|
return join(map(neobundle#config#get_neobundles(), 'v:val.name'), "\n")
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
" @vimlint(EVL103, 0, a:ArgLead)
|
" @vimlint(EVL103, 0, a:ArgLead)
|
||||||
" @vimlint(EVL103, 0, a:CmdLine)
|
" @vimlint(EVL103, 0, a:CmdLine)
|
||||||
@ -98,6 +102,11 @@ endfunction
|
|||||||
|
|
||||||
function! SpaceVim#commands#update_plugin(...) abort
|
function! SpaceVim#commands#update_plugin(...) abort
|
||||||
if g:spacevim_plugin_manager ==# 'neobundle'
|
if g:spacevim_plugin_manager ==# 'neobundle'
|
||||||
|
if a:0 == 0
|
||||||
|
call SpaceVim#plugins#manager#update()
|
||||||
|
else
|
||||||
|
call SpaceVim#plugins#manager#update(a:000)
|
||||||
|
endif
|
||||||
elseif g:spacevim_plugin_manager ==# 'dein'
|
elseif g:spacevim_plugin_manager ==# 'dein'
|
||||||
if a:0 == 0
|
if a:0 == 0
|
||||||
call SpaceVim#plugins#manager#update()
|
call SpaceVim#plugins#manager#update()
|
||||||
@ -118,11 +127,16 @@ endfunction
|
|||||||
|
|
||||||
function! SpaceVim#commands#install_plugin(...) abort
|
function! SpaceVim#commands#install_plugin(...) abort
|
||||||
if g:spacevim_plugin_manager ==# 'neobundle'
|
if g:spacevim_plugin_manager ==# 'neobundle'
|
||||||
|
if a:0 == 0
|
||||||
|
call SpaceVim#plugins#manager#install()
|
||||||
|
else
|
||||||
|
call SpaceVim#plugins#manager#install(a:000)
|
||||||
|
endif
|
||||||
elseif g:spacevim_plugin_manager ==# 'dein'
|
elseif g:spacevim_plugin_manager ==# 'dein'
|
||||||
if a:0 == 0
|
if a:0 == 0
|
||||||
call SpaceVim#plugins#manager#install()
|
call SpaceVim#plugins#manager#install()
|
||||||
else
|
else
|
||||||
call dein#install(a:000)
|
call SpaceVim#plugins#manager#install(a:000)
|
||||||
endif
|
endif
|
||||||
elseif g:spacevim_plugin_manager ==# 'vim-plug'
|
elseif g:spacevim_plugin_manager ==# 'vim-plug'
|
||||||
endif
|
endif
|
||||||
|
@ -106,14 +106,25 @@ function! s:need_cmd(cmd) abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:get_uninstalled_plugins() abort
|
if g:spacevim_plugin_manager ==# 'neobundle'
|
||||||
return filter(values(dein#get()), '!isdirectory(v:val.path)')
|
function! s:get_uninstalled_plugins() abort
|
||||||
endfunction
|
return filter(neobundle#config#get_neobundles(), '!isdirectory(v:val.path)')
|
||||||
|
endfunction
|
||||||
|
elseif g:spacevim_plugin_manager ==# 'dein'
|
||||||
|
function! s:get_uninstalled_plugins() abort
|
||||||
|
return filter(values(dein#get()), '!isdirectory(v:val.path)')
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
|
|
||||||
|
if g:spacevim_plugin_manager ==# 'neobundle'
|
||||||
function! SpaceVim#plugins#manager#reinstall(...) abort
|
function! SpaceVim#plugins#manager#reinstall(...) abort
|
||||||
call dein#reinstall(a:1)
|
call neobundle#commands#reinstall(a:1)
|
||||||
endfunction
|
endfunction
|
||||||
|
elseif g:spacevim_plugin_manager ==# 'dein'
|
||||||
|
function! SpaceVim#plugins#manager#reinstall(...) abort
|
||||||
|
call dein#reinstall(a:1)
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
" @vimlint(EVL102, 1, l:i)
|
" @vimlint(EVL102, 1, l:i)
|
||||||
@ -152,7 +163,11 @@ function! SpaceVim#plugins#manager#install(...) abort
|
|||||||
let s:start_time = reltime()
|
let s:start_time = reltime()
|
||||||
for i in range(g:spacevim_plugin_manager_processes)
|
for i in range(g:spacevim_plugin_manager_processes)
|
||||||
if !empty(s:plugins)
|
if !empty(s:plugins)
|
||||||
let repo = dein#get(s:LIST.shift(s:plugins))
|
if g:spacevim_plugin_manager ==# 'dein'
|
||||||
|
let repo = dein#get(s:LIST.shift(s:plugins))
|
||||||
|
elseif g:spacevim_plugin_manager ==# 'neobundle'
|
||||||
|
let repo = neobundle#get(s:LIST.shift(s:plugins))
|
||||||
|
endif
|
||||||
if !empty(repo)
|
if !empty(repo)
|
||||||
call s:install(repo)
|
call s:install(repo)
|
||||||
endif
|
endif
|
||||||
@ -184,7 +199,12 @@ function! SpaceVim#plugins#manager#update(...) abort
|
|||||||
if exists('s:recache_done')
|
if exists('s:recache_done')
|
||||||
unlet s:recache_done
|
unlet s:recache_done
|
||||||
endif
|
endif
|
||||||
let s:plugins = a:0 == 0 ? sort(keys(dein#get())) : sort(copy(a:1))
|
if g:spacevim_plugin_manager ==# 'dein'
|
||||||
|
let s:plugins = a:0 == 0 ? sort(keys(dein#get())) : sort(copy(a:1))
|
||||||
|
elseif g:spacevim_plugin_manager ==# 'neobundle'
|
||||||
|
let s:plugins = a:0 == 0 ? sort(map(neobundle#config#get_neobundles(), 'v:val.name')) : sort(copy(a:1))
|
||||||
|
elseif g:spacevim_plugin_manager ==# 'vim-plug'
|
||||||
|
endif
|
||||||
if a:0 == 0
|
if a:0 == 0
|
||||||
call add(s:plugins, 'SpaceVim')
|
call add(s:plugins, 'SpaceVim')
|
||||||
endif
|
endif
|
||||||
@ -203,8 +223,13 @@ function! SpaceVim#plugins#manager#update(...) abort
|
|||||||
let s:start_time = reltime()
|
let s:start_time = reltime()
|
||||||
for i in range(g:spacevim_plugin_manager_processes)
|
for i in range(g:spacevim_plugin_manager_processes)
|
||||||
if !empty(s:plugins)
|
if !empty(s:plugins)
|
||||||
let reponame = s:LIST.shift(s:plugins)
|
if g:spacevim_plugin_manager ==# 'dein'
|
||||||
let repo = dein#get(reponame)
|
let reponame = s:LIST.shift(s:plugins)
|
||||||
|
let repo = dein#get(reponame)
|
||||||
|
elseif g:spacevim_plugin_manager ==# 'neobundle'
|
||||||
|
let reponame = s:LIST.shift(s:plugins)
|
||||||
|
let repo = neobundle#get(reponame)
|
||||||
|
endif
|
||||||
if !empty(repo)
|
if !empty(repo)
|
||||||
call s:pull(repo)
|
call s:pull(repo)
|
||||||
elseif reponame ==# 'SpaceVim'
|
elseif reponame ==# 'SpaceVim'
|
||||||
@ -388,7 +413,7 @@ endfunction
|
|||||||
function! s:install(repo) abort
|
function! s:install(repo) abort
|
||||||
let s:pct += 1
|
let s:pct += 1
|
||||||
let s:ui_buf[a:repo.name] = s:pct
|
let s:ui_buf[a:repo.name] = s:pct
|
||||||
let url = 'https://github.com/' . a:repo.repo
|
let url = 'https://github.com/' . (has_key(a:repo, 'repo') ? a:repo.repo : a:repo.orig_path)
|
||||||
let argv = ['git', 'clone', '--recursive', '--progress', url, a:repo.path]
|
let argv = ['git', 'clone', '--recursive', '--progress', url, a:repo.path]
|
||||||
if s:JOB.vim_job || s:JOB.nvim_job
|
if s:JOB.vim_job || s:JOB.nvim_job
|
||||||
let jobid = s:JOB.start(argv,{
|
let jobid = s:JOB.start(argv,{
|
||||||
@ -550,12 +575,18 @@ function! s:open_plugin_dir() abort
|
|||||||
enew
|
enew
|
||||||
exe 'resize ' . &lines * 30 / 100
|
exe 'resize ' . &lines * 30 / 100
|
||||||
let shell = empty($SHELL) ? SpaceVim#api#import('system').isWindows ? 'cmd.exe' : 'bash' : $SHELL
|
let shell = empty($SHELL) ? SpaceVim#api#import('system').isWindows ? 'cmd.exe' : 'bash' : $SHELL
|
||||||
|
if g:spacevim_plugin_manager ==# 'dein'
|
||||||
|
let path = dein#get(keys(plugin)[0]).path
|
||||||
|
elseif g:spacevim_plugin_manager ==# 'neobundle'
|
||||||
|
let path = neobundle#get(keys(plugin)[0]).path
|
||||||
|
elseif g:spacevim_plugin_manager ==# 'vim-plug'
|
||||||
|
endif
|
||||||
if has('nvim') && exists('*termopen')
|
if has('nvim') && exists('*termopen')
|
||||||
call termopen(shell, {'cwd' : dein#get(keys(plugin)[0]).path})
|
call termopen(shell, {'cwd' : path})
|
||||||
elseif exists('*term_start')
|
elseif exists('*term_start')
|
||||||
call term_start(shell, {'curwin' : 1, 'term_finish' : 'close', 'cwd' : dein#get(keys(plugin)[0]).path})
|
call term_start(shell, {'curwin' : 1, 'term_finish' : 'close', 'cwd' : path})
|
||||||
else
|
else
|
||||||
exe 'VimShell ' . dein#get(keys(plugin)[0]).path
|
exe 'VimShell ' . path
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -103,7 +103,13 @@ function! zvim#plug#end() abort
|
|||||||
if g:spacevim_plugin_manager ==# 'neobundle'
|
if g:spacevim_plugin_manager ==# 'neobundle'
|
||||||
call neobundle#end()
|
call neobundle#end()
|
||||||
if g:spacevim_checkinstall == 1
|
if g:spacevim_checkinstall == 1
|
||||||
NeoBundleCheck
|
silent! let g:_spacevim_checking_flag = neobundle#exists_not_installed_bundles()
|
||||||
|
if g:_spacevim_checking_flag
|
||||||
|
augroup SpaceVimCheckInstall
|
||||||
|
au!
|
||||||
|
au VimEnter * SPInstall
|
||||||
|
augroup END
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
elseif g:spacevim_plugin_manager ==# 'dein'
|
elseif g:spacevim_plugin_manager ==# 'dein'
|
||||||
call dein#end()
|
call dein#end()
|
||||||
|
@ -540,10 +540,6 @@ plugins will be installed.
|
|||||||
*g:spacevim_filemanager*
|
*g:spacevim_filemanager*
|
||||||
The default file manager of SpaceVim. Default is 'vimfiler'.
|
The default file manager of SpaceVim. Default is 'vimfiler'.
|
||||||
|
|
||||||
*g:spacevim_plugin_manager*
|
|
||||||
The default plugin manager of SpaceVim. Default is 'dein'. Options are dein,
|
|
||||||
neobundle, or vim-plug.
|
|
||||||
|
|
||||||
*g:spacevim_plugin_manager_processes*
|
*g:spacevim_plugin_manager_processes*
|
||||||
Set the max process of SpaceVim plugin manager
|
Set the max process of SpaceVim plugin manager
|
||||||
|
|
||||||
|
2
init.vim
2
init.vim
@ -6,4 +6,6 @@
|
|||||||
" License: GPLv3
|
" License: GPLv3
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
|
" call neobundle#get()
|
||||||
|
|
||||||
execute 'source' fnamemodify(expand('<sfile>'), ':h').'/config/main.vim'
|
execute 'source' fnamemodify(expand('<sfile>'), ':h').'/config/main.vim'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user