diff --git a/autoload/airline/extensions.vim b/autoload/airline/extensions.vim index 71f02d6c..f1ec5a68 100644 --- a/autoload/airline/extensions.vim +++ b/autoload/airline/extensions.vim @@ -1,5 +1,5 @@ -" MIT license. Copyright (c) 2013 Bailey Ling. -" vim: ts=2 sts=2 sw=2 fdm=indent +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 let s:ext = {} let s:ext._cursormove_funcrefs = [] @@ -128,15 +128,18 @@ function! airline#extensions#load() call airline#extensions#undotree#init(s:ext) endif - if get(g:, 'airline_enable_hunks', 1) && exists('*GitGutterGetHunkSummary') + if (get(g:, 'airline#extensions#hunks#enabled', 1) && get(g:, 'airline_enable_hunks', 1)) + \ && exists('*GitGutterGetHunkSummary') call airline#extensions#hunks#init(s:ext) endif - if g:airline_enable_tagbar && exists(':TagbarToggle') + if (get(g:, 'airline#extensions#tagbar#enabled', 1) && get(g:, 'airline_enable_tagbar', 1)) + \ && exists(':TagbarToggle') call airline#extensions#tagbar#init(s:ext) endif - if g:airline_enable_csv && (get(g:, 'loaded_csv', 0) || exists(':Table')) + if (get(g:, 'airline#extensions#csv#enabled', 1) && get(g:, 'airline_enable_csv', 1)) + \ && (get(g:, 'loaded_csv', 0) || exists(':Table')) call airline#extensions#csv#init(s:ext) endif @@ -145,15 +148,18 @@ function! airline#extensions#load() let s:filetype_regex_overrides['^int-'] = ['vimshell','%{substitute(&ft, "int-", "", "")}'] endif - if g:airline_enable_branch && (get(g:, 'loaded_fugitive', 0) || get(g:, 'loaded_lawrencium', 0)) + if (get(g:, 'airline#extensions#branch#enabled', 1) && get(g:, 'airline_enable_branch', 1)) + \ && (get(g:, 'loaded_fugitive', 0) || get(g:, 'loaded_lawrencium', 0)) call airline#extensions#branch#init(s:ext) endif - if g:airline_enable_syntastic && get(g:, 'loaded_syntastic_plugin') + if (get(g:, 'airline#extensions#syntastic#enabled', 1) && get(g:, 'airline_enable_syntastic', 1)) + \ && exists(':SyntasticCheck') call airline#extensions#syntastic#init(s:ext) endif - if g:airline_enable_bufferline && exists('*bufferline#get_status_string') + if (get(g:, 'airline#extensions#bufferline#enabled', 1) && get(g:, 'airline_enable_bufferline', 1)) + \ && exists('*bufferline#get_status_string') call airline#extensions#bufferline#init(s:ext) endif diff --git a/doc/airline.txt b/doc/airline.txt index 6ae9a192..0b54a57d 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -179,7 +179,7 @@ fugitive.vim lawrencium * enable/disable fugitive/lawrencium integration > - let g:airline_enable_branch = 1 + let g:airline#extensions#branch#enabled = 1 < * change the text for when no branch is detected > let g:airline#extensions#branch#empty_message = '' @@ -188,19 +188,19 @@ lawrencium syntastic * enable/disable syntastic integration > - let g:airline_enable_syntastic = 1 + let g:airline#extensions#syntastic#enabled = 1 < *airline-tagbar* tagbar * enable/disable tagbar integration > - let g:airline_enable_tagbar = 1 + let g:airline#extensions#tagbar#enabled = 1 < *airline-csv* csv.vim * enable/disable csv integration for displaying the current column. > - let g:airline_enable_csv = 1 + let g:airline#extensions#csv#enabled = 1 < * change how columns are displayed. > let g:airline#extensions#csv#column_display = 'Number' (default) @@ -210,7 +210,7 @@ csv.vim vim-gitgutter * enable/disable detecting changed hunks under source control. > - let g:airline_enable_hunks = 1 + let g:airline#extensions#hunks#enabled = 1 < * enable/disable showing only non-zero hunks. > let g:airline#extensions#hunks#non_zero_only = 0 diff --git a/plugin/airline.vim b/plugin/airline.vim index 0d9d8d3c..3e100cd3 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -16,11 +16,6 @@ call s:check_defined('g:airline_left_sep', exists('g:airline_powerline_fonts')?" call s:check_defined('g:airline_left_alt_sep', exists('g:airline_powerline_fonts')?"":">") call s:check_defined('g:airline_right_sep', exists('g:airline_powerline_fonts')?"":"<") call s:check_defined('g:airline_right_alt_sep', exists('g:airline_powerline_fonts')?"":"<") -call s:check_defined('g:airline_enable_bufferline', 1) -call s:check_defined('g:airline_enable_branch', 1) -call s:check_defined('g:airline_enable_syntastic', 1) -call s:check_defined('g:airline_enable_tagbar', 1) -call s:check_defined('g:airline_enable_csv', 1) call s:check_defined('g:airline_detect_iminsert', 0) call s:check_defined('g:airline_detect_modified', 1) call s:check_defined('g:airline_detect_paste', 1)