diff --git a/doc/airline.txt b/doc/airline.txt index 459f426c..50b36a41 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -154,7 +154,7 @@ example that you could add to your vimrc: COMMANDS *airline-commands* > :AirlineTheme {theme-name} *:AirlineTheme* - Changes the current airline theme. + Displayes or changes the current theme. ============================================================================== CONTRIBUTIONS *airline-contributions* diff --git a/plugin/airline.vim b/plugin/airline.vim index 9899234e..3621af94 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -55,7 +55,13 @@ function! s:get_airline_themes(a, l, p) let files = split(globpath(&rtp, 'autoload/airline/themes/'.a:a.'*'), "\n") return map(files, 'fnamemodify(v:val, ":t:r")') endfunction -command! -nargs=1 -complete=customlist,get_airline_themes AirlineTheme call airline#load_theme() +function! s:airline_theme(...) + if a:0 + call airline#load_theme(a:1) + endif + echo g:airline_theme +endfunction +command! -nargs=? -complete=customlist,get_airline_themes AirlineTheme call airline_theme() augroup airline au!