mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-22 08:59:14 +08:00
provide option to disable runtimepath extension loading. resolves #483
This commit is contained in:
parent
e49eac95a3
commit
fafb9ea76e
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user