diff --git a/autoload/airline/extensions.vim b/autoload/airline/extensions.vim index e07bd60..5050631 100644 --- a/autoload/airline/extensions.vim +++ b/autoload/airline/extensions.vim @@ -207,22 +207,24 @@ function! airline#extensions#load() call airline#extensions#promptline#init(s:ext) endif - " Load all other extensions, which are not part of the default distribution. - " (autoload/airline/extensions/*.vim outside of our s:script_path). - for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n") - " we have to check both resolved and unresolved paths, since it's possible - " that they might not get resolved properly (see #187) - if stridx(tolower(resolve(fnamemodify(file, ':p'))), s:script_path) < 0 - \ && stridx(tolower(fnamemodify(file, ':p')), s:script_path) < 0 - let name = fnamemodify(file, ':t:r') - if !get(g:, 'airline#extensions#'.name.'#enabled', 1) - continue + 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). + for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n") + " we have to check both resolved and unresolved paths, since it's possible + " that they might not get resolved properly (see #187) + if stridx(tolower(resolve(fnamemodify(file, ':p'))), s:script_path) < 0 + \ && stridx(tolower(fnamemodify(file, ':p')), s:script_path) < 0 + let name = fnamemodify(file, ':t:r') + if !get(g:, 'airline#extensions#'.name.'#enabled', 1) + continue + endif + try + call airline#extensions#{name}#init(s:ext) + catch + endtry endif - try - call airline#extensions#{name}#init(s:ext) - catch - endtry - endif - endfor + endfor + endif endfunction diff --git a/doc/airline.txt b/doc/airline.txt index 8134239..f820634 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -217,6 +217,14 @@ EXTENSIONS *airline-extensions* Most extensions are enabled by default and lazily loaded when the 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* The default extension understands all of the `g:` variables in the |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' ] \ ]) < - ------------------------------------- *airline-quickfix* The quickfix extension is a simple built-in extension which determines whether the buffer is a quickfix or location list buffer, and adjusts the