provide option to disable runtimepath extension loading. resolves #483

This commit is contained in:
Bailey Ling 2014-04-19 14:38:02 -04:00
parent e49eac95a3
commit fafb9ea76e
2 changed files with 26 additions and 17 deletions

View File

@ -207,7 +207,8 @@ function! airline#extensions#load()
call airline#extensions#promptline#init(s:ext) call airline#extensions#promptline#init(s:ext)
endif endif
" Load all other extensions, which are not part of the default distribution. if !get(g:, 'airline#extensions#disable_rtp_load', 0)
" load all other extensions, which are not part of the default distribution.
" (autoload/airline/extensions/*.vim outside of our s:script_path). " (autoload/airline/extensions/*.vim outside of our s:script_path).
for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n") for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n")
" we have to check both resolved and unresolved paths, since it's possible " we have to check both resolved and unresolved paths, since it's possible
@ -224,5 +225,6 @@ function! airline#extensions#load()
endtry endtry
endif endif
endfor endfor
endif
endfunction endfunction

View File

@ -217,6 +217,14 @@ EXTENSIONS *airline-extensions*
Most extensions are enabled by default and lazily loaded when the Most extensions are enabled by default and lazily loaded when the
corresponding plugin (if any) is detected. corresponding plugin (if any) is detected.
By default, airline will attempt to load any extension it can find in the
'runtimepath'. On some systems this can result in an undersirable startup
cost. You can disable the check with the following flag. >
let g:airline#extensions#disable_rtp_load = 1
<
Note: Third party plugins that rely on this behavior will be affected. You
will need to manually load them.
------------------------------------- *airline-default* ------------------------------------- *airline-default*
The default extension understands all of the `g:` variables in the The default extension understands all of the `g:` variables in the
|airline-configuration| section, however it also has some more fine-tuned |airline-configuration| section, however it also has some more fine-tuned
@ -240,7 +248,6 @@ configuration values that you can use.
\ [ 'x', 'y', 'z', 'warning' ] \ [ 'x', 'y', 'z', 'warning' ]
\ ]) \ ])
< <
------------------------------------- *airline-quickfix* ------------------------------------- *airline-quickfix*
The quickfix extension is a simple built-in extension which determines The quickfix extension is a simple built-in extension which determines
whether the buffer is a quickfix or location list buffer, and adjusts the whether the buffer is a quickfix or location list buffer, and adjusts the