cfg-pre - Fixed loading plugin configurations
This commit is contained in:
parent
e2db0b2e6e
commit
bbddb43c37
1 changed files with 11 additions and 11 deletions
|
@ -34,6 +34,10 @@ if has( 'vim_starting' )
|
||||||
let &g:runtimepath = &g:runtimepath . "," . s:dein_path
|
let &g:runtimepath = &g:runtimepath . "," . s:dein_path
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
call dein#options(#{
|
||||||
|
\ lazy_plugins: v:true,
|
||||||
|
\ install_progress_type: 'floating',
|
||||||
|
\ })
|
||||||
call dein#begin( g:bundles_dir )
|
call dein#begin( g:bundles_dir )
|
||||||
|
|
||||||
" Load Dein itself
|
" Load Dein itself
|
||||||
|
@ -48,21 +52,17 @@ for s:plfn in values( s:bundle_load_files )
|
||||||
|
|
||||||
" Create configuration loading hooks
|
" Create configuration loading hooks
|
||||||
let s:pname = fnamemodify( s:plfn , ":t:r:r" )
|
let s:pname = fnamemodify( s:plfn , ":t:r:r" )
|
||||||
let s:bundle = dein#get( s:pname )
|
let s:cfgfile = GetConfigFilePath( s:plugins_dir ,
|
||||||
if empty( s:bundle )
|
\ s:pname . ".cfg.vim" )
|
||||||
continue
|
if s:cfgfile != ""
|
||||||
|
call dein#set_hook(s:pname, 'hook_post_source',
|
||||||
|
\ join(readfile(s:cfgfile), "\n")
|
||||||
|
\ )
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! s:bundle.hooks.on_post_source( bundle )
|
|
||||||
let cfgfile = GetConfigFilePath( s:plugins_dir ,
|
|
||||||
\ a:bundle.name . ".cfg.vim" )
|
|
||||||
if l:cfgfile != ""
|
|
||||||
execute "source" l:cfgfile
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
call dein#end()
|
call dein#end()
|
||||||
|
autocmd VimEnter * call dein#call_hook('post_source')
|
||||||
|
|
||||||
function! CheckDeinInstall()
|
function! CheckDeinInstall()
|
||||||
" Let Dein check for installations
|
" Let Dein check for installations
|
||||||
|
|
Loading…
Reference in a new issue