NeoBundle uses runtime directory
* Initial version included here as submodule * Use version from g:vim_vardata/bundles otherwise * This avoids polluting the configuration directory with bundles
This commit is contained in:
parent
bd749b79d0
commit
49b97afd6a
7 changed files with 38 additions and 29 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1 @@
|
|||
/bundle
|
||||
/.netrwhist
|
||||
/keys
|
||||
|
|
7
.gitmodules
vendored
7
.gitmodules
vendored
|
@ -1,6 +1,3 @@
|
|||
[submodule "bundle/neobundle.vim"]
|
||||
path = bundle/neobundle.vim
|
||||
[submodule "neobundle-initial"]
|
||||
path = neobundle-initial
|
||||
url = https://github.com/Shougo/neobundle.vim.git
|
||||
[submodule "bundle/vimproc.vim"]
|
||||
path = bundle/vimproc.vim
|
||||
url = https://github.com/Shougo/vimproc.vim.git
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 04b45cd80f48f66daed04a1a48a7ea4e7d316086
|
9
bundles-init/vimproc.vim.load.vim
Normal file
9
bundles-init/vimproc.vim.load.vim
Normal file
|
@ -0,0 +1,9 @@
|
|||
NeoBundle 'Shougo/vimproc.vim', {
|
||||
\ 'build' : {
|
||||
\ 'windows' : 'tools\\update-dll-mingw',
|
||||
\ 'cygwin' : 'make -f make_cygwin.mak',
|
||||
\ 'mac' : 'make -f make_mac.mak',
|
||||
\ 'linux' : 'make',
|
||||
\ 'unix' : 'gmake',
|
||||
\ },
|
||||
\ }
|
|
@ -1,34 +1,48 @@
|
|||
" Load and initialise NeoBundle and plugins
|
||||
|
||||
let s:bundles_dir = g:vim_home . "/bundle/"
|
||||
if !exists( "g:bundles_dir" )
|
||||
let g:bundles_dir = g:vim_vardata . "/bundles/"
|
||||
elseif g:bundles_dir !~ "/$"
|
||||
let g:bundles_dir = g:bundles_dir . "/"
|
||||
endif
|
||||
if !CreateDirectoryIfNecessary( g:bundles_dir )
|
||||
unlet g:bundles_dir
|
||||
finish
|
||||
endif
|
||||
|
||||
if has( 'vim_starting' )
|
||||
if &compatible
|
||||
set nocompatible
|
||||
endif
|
||||
|
||||
let s:neobundle_path=s:bundles_dir . "neobundle.vim/"
|
||||
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
|
||||
let &g:runtimepath = &g:runtimepath . "," . s:neobundle_path
|
||||
endif
|
||||
|
||||
call neobundle#begin( s:bundles_dir )
|
||||
call neobundle#begin( g:bundles_dir )
|
||||
|
||||
" Load NeoBundle itself, as well as VimProc
|
||||
NeoBundleFetch 'Shougo/neobundle.vim'
|
||||
NeoBundle 'Shougo/vimproc.vim', {
|
||||
\ 'build' : {
|
||||
\ 'windows' : 'tools\\update-dll-mingw',
|
||||
\ 'cygwin' : 'make -f make_cygwin.mak',
|
||||
\ 'mac' : 'make -f make_mac.mak',
|
||||
\ 'linux' : 'make',
|
||||
\ 'unix' : 'gmake',
|
||||
\ },
|
||||
\ }
|
||||
|
||||
" 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
|
||||
|
||||
" 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
|
||||
endfor
|
||||
|
||||
call neobundle#end()
|
||||
|
|
|
@ -16,17 +16,9 @@ NeoBundleCheck
|
|||
" Call hooks on reload
|
||||
if !has( "vim_starting" )
|
||||
call neobundle#call_hook( "on_source" )
|
||||
call neobundle#call_hook( "on_post_source" )
|
||||
endif
|
||||
|
||||
" Load configuration files for all installed plugins
|
||||
let s:binit_dir = g:vim_home . "/bundles-init"
|
||||
for s:pcfn in glob( s:binit_dir . "/*.cfg.vim" , 0 , 1 )
|
||||
let s:pname = fnamemodify( s:pcfn , ":t:r:r" )
|
||||
if neobundle#is_installed( s:pname )
|
||||
execute "source" s:pcfn
|
||||
endif
|
||||
endfor
|
||||
|
||||
" Restore filetype settings
|
||||
if ! s:has_fti
|
||||
filetype indent off
|
||||
|
|
Loading…
Reference in a new issue