2015-02-22 10:37:39 +01:00
|
|
|
" Load and initialise NeoBundle and plugins
|
|
|
|
|
2015-02-22 17:25:10 +01:00
|
|
|
if !exists( "g:bundles_dir" )
|
2015-02-23 08:33:14 +01:00
|
|
|
if exists( "g:vim_local['local_bundles']" )
|
|
|
|
if !exists( "g:vim_local['vardata']" )
|
|
|
|
echo "Local bundles requested, but local data directory is not set."
|
|
|
|
endif
|
|
|
|
let g:bundles_dir = GetVardataPath( "bundles" )
|
|
|
|
else
|
|
|
|
let g:bundles_dir = g:vim_vardata . "/bundles/"
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
if g:bundles_dir !~ "/$"
|
2015-02-22 17:25:10 +01:00
|
|
|
let g:bundles_dir = g:bundles_dir . "/"
|
|
|
|
endif
|
|
|
|
if !CreateDirectoryIfNecessary( g:bundles_dir )
|
|
|
|
unlet g:bundles_dir
|
|
|
|
finish
|
|
|
|
endif
|
2015-02-22 10:37:39 +01:00
|
|
|
|
|
|
|
if has( 'vim_starting' )
|
|
|
|
if &compatible
|
|
|
|
set nocompatible
|
|
|
|
endif
|
|
|
|
|
2015-02-22 17:25:10 +01:00
|
|
|
if isdirectory( g:bundles_dir . "neobundle.vim" )
|
|
|
|
let s:neobundle_path = g:bundles_dir . "neobundle.vim"
|
|
|
|
else
|
|
|
|
let s:neobundle_path = g:vim_home . "/neobundle-initial"
|
|
|
|
endif
|
2015-02-22 10:37:39 +01:00
|
|
|
let &g:runtimepath = &g:runtimepath . "," . s:neobundle_path
|
|
|
|
endif
|
|
|
|
|
2015-02-22 17:25:10 +01:00
|
|
|
call neobundle#begin( g:bundles_dir )
|
2015-02-22 10:37:39 +01:00
|
|
|
|
2015-02-22 16:18:12 +01:00
|
|
|
" Load NeoBundle itself, as well as VimProc
|
2015-02-22 10:37:39 +01:00
|
|
|
NeoBundleFetch 'Shougo/neobundle.vim'
|
2015-02-22 16:18:12 +01:00
|
|
|
|
|
|
|
" Load all plugins from bundles-init/*.load
|
|
|
|
let s:binit_dir = g:vim_home . "/bundles-init"
|
|
|
|
for s:plfn in glob( s:binit_dir . "/*.load.vim" , 0 , 1 )
|
|
|
|
execute "source" s:plfn
|
2015-02-22 17:25:10 +01:00
|
|
|
|
|
|
|
" Create configuration loading hooks
|
|
|
|
let s:pname = fnamemodify( s:plfn , ":t:r:r" )
|
|
|
|
let s:bundle = neobundle#get( s:pname )
|
|
|
|
|
|
|
|
function! s:bundle.hooks.on_post_source( bundle )
|
|
|
|
let cfgfile = s:binit_dir . "/" . a:bundle.name . ".cfg.vim"
|
|
|
|
if filereadable( l:cfgfile )
|
|
|
|
execute "source" l:cfgfile
|
|
|
|
endif
|
|
|
|
endfunction
|
2015-02-22 16:18:12 +01:00
|
|
|
endfor
|
2015-02-22 10:37:39 +01:00
|
|
|
|
|
|
|
call neobundle#end()
|