From 6366ba9d2477671e80e4a06e2419710ebd11f7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Mon, 23 Feb 2015 08:35:09 +0100 Subject: [PATCH] Bundles installer made into a function --- config-bits/50-install-bundles.vim | 57 +++++++++++++++++------------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/config-bits/50-install-bundles.vim b/config-bits/50-install-bundles.vim index 676335c..835e117 100644 --- a/config-bits/50-install-bundles.vim +++ b/config-bits/50-install-bundles.vim @@ -1,31 +1,38 @@ " Force NeoBundle to check the loaded plugins and install them -" Save current filetype settings -let s:has_ft = exists( "did_load_filetypes" ) -let s:has_fti = exists( "did_indent_on" ) -let s:has_ftp = exists( "did_load_ftplugin" ) +function! DoNeoBundleCheck() + " Save current filetype settings + let s:has_ft = exists( "g:did_load_filetypes" ) + 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 -if !( s:has_ft && s:has_fti && s:has_ftp ) - filetype plugin indent on -endif + " Enable filetype with both indent and plugins + if !( s:has_ft && s:has_fti && s:has_ftp ) + filetype plugin indent on + endif -" Let NeoBundle check for installations -NeoBundleCheck + " Let NeoBundle check for installations + NeoBundleCheck -" Call hooks on reload -if !has( "vim_starting" ) - call neobundle#call_hook( "on_source" ) - call neobundle#call_hook( "on_post_source" ) -endif + " Call hooks on reload + if !has( "vim_starting" ) + call neobundle#call_hook( "on_post_source" ) + endif -" Restore filetype settings -if ! s:has_fti - filetype indent off -endif -if ! s:has_ftp - filetype plugin off -endif -if ! s:has_ft - filetype off -endif + " Restore filetype settings + if ! s:has_fti + filetype indent off + endif + if ! s:has_ftp + filetype plugin off + endif + if ! s:has_ft + filetype off + endif +endfunction + +call DoNeoBundleCheck( ) + +" Do mappings somewhere else +" nmap :NeoBundleCheckUpdate +" nmap :call DoNeoBundleCheck()