Bundles installer made into a function
This commit is contained in:
parent
291d58c9a8
commit
6366ba9d24
1 changed files with 32 additions and 25 deletions
|
@ -1,31 +1,38 @@
|
||||||
" Force NeoBundle to check the loaded plugins and install them
|
" Force NeoBundle to check the loaded plugins and install them
|
||||||
|
|
||||||
" Save current filetype settings
|
function! DoNeoBundleCheck()
|
||||||
let s:has_ft = exists( "did_load_filetypes" )
|
" Save current filetype settings
|
||||||
let s:has_fti = exists( "did_indent_on" )
|
let s:has_ft = exists( "g:did_load_filetypes" )
|
||||||
let s:has_ftp = exists( "did_load_ftplugin" )
|
let s:has_fti = exists( "g:did_indent_on" )
|
||||||
|
let s:has_ftp = exists( "g:did_load_ftplugin" )
|
||||||
|
|
||||||
" Enable filetype with both indent and plugins
|
" Enable filetype with both indent and plugins
|
||||||
if !( s:has_ft && s:has_fti && s:has_ftp )
|
if !( s:has_ft && s:has_fti && s:has_ftp )
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Let NeoBundle check for installations
|
" Let NeoBundle check for installations
|
||||||
NeoBundleCheck
|
NeoBundleCheck
|
||||||
|
|
||||||
" Call hooks on reload
|
" Call hooks on reload
|
||||||
if !has( "vim_starting" )
|
if !has( "vim_starting" )
|
||||||
call neobundle#call_hook( "on_source" )
|
|
||||||
call neobundle#call_hook( "on_post_source" )
|
call neobundle#call_hook( "on_post_source" )
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Restore filetype settings
|
" Restore filetype settings
|
||||||
if ! s:has_fti
|
if ! s:has_fti
|
||||||
filetype indent off
|
filetype indent off
|
||||||
endif
|
endif
|
||||||
if ! s:has_ftp
|
if ! s:has_ftp
|
||||||
filetype plugin off
|
filetype plugin off
|
||||||
endif
|
endif
|
||||||
if ! s:has_ft
|
if ! s:has_ft
|
||||||
filetype off
|
filetype off
|
||||||
endif
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
call DoNeoBundleCheck( )
|
||||||
|
|
||||||
|
" Do mappings somewhere else
|
||||||
|
" nmap <silent> <S-F12> :NeoBundleCheckUpdate<cr>
|
||||||
|
" nmap <silent> <C-F12> :call DoNeoBundleCheck()<cr>
|
||||||
|
|
Loading…
Reference in a new issue