From 50e47ced42bc30eec99a91c96cd5b1910450a569 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sat, 28 Feb 2015 17:40:23 -0500 Subject: [PATCH] add g:airline_extensions variable for manual loading --- autoload/airline/extensions.vim | 7 +++++++ doc/airline.txt | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/autoload/airline/extensions.vim b/autoload/airline/extensions.vim index 18bbf9e..ce83c09 100644 --- a/autoload/airline/extensions.vim +++ b/autoload/airline/extensions.vim @@ -121,6 +121,13 @@ function! airline#extensions#load() " non-trivial number of external plugins use eventignore=all, so we need to account for that autocmd CursorMoved * call sync_active_winnr() + if exists('g:airline_extensions') + for ext in g:airline_extensions + call airline#extensions#{ext}#init(s:ext) + endfor + return + endif + call airline#extensions#quickfix#init(s:ext) if get(g:, 'loaded_unite', 0) diff --git a/doc/airline.txt b/doc/airline.txt index 489c090..5099fe7 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -242,6 +242,15 @@ cost. You can disable the check with the following flag. > Note: Third party plugins that rely on this behavior will be affected. You will need to manually load them. +Alternatively, if you want a minimalistic setup and would rather opt-in which +extensions get loaded instead of disabling each individually, you can declare +the following list variable: > + " an empty list disables all extensions + let g:airline_extensions = [] + + " or only load what you want + let g:airline_extensions = ['branch', 'tabline'] +< ------------------------------------- *airline-default* The default extension understands all of the `g:` variables in the |airline-configuration| section, however it also has some more fine-tuned