Add :AirlineExtensions command

This shows whether or not an extensions has been loaded.
This commit is contained in:
Christian Brabandt
2018-11-14 08:06:39 +01:00
parent f6a95d3a6f
commit df0c1731db
3 changed files with 68 additions and 45 deletions

View File

@@ -179,10 +179,25 @@ function! s:FocusGainedHandler(timer)
endif
endfu
function! s:airline_extensions()
let loaded = airline#extensions#get_loaded_extensions()
let files = split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n")
call map(files, 'fnamemodify(v:val, ":t:r")')
if !empty(files)
echohl Title
echo printf("%-15s\t%s", "Extension", "Status")
echohl Normal
endif
for ext in sort(files)
echo printf("%-15s\t%sloaded", ext, (index(loaded, ext) == -1 ? 'not ' : ''))
endfor
endfunction
command! -bar -nargs=? -complete=customlist,<sid>get_airline_themes AirlineTheme call <sid>airline_theme(<f-args>)
command! -bar AirlineToggleWhitespace call airline#extensions#whitespace#toggle()
command! -bar AirlineToggle call s:airline_toggle()
command! -bar AirlineToggle call s:airline_toggle()
command! -bar AirlineRefresh call s:airline_refresh()
command! AirlineExtensions call s:airline_extensions()
call airline#init#bootstrap()
call s:airline_toggle()