make :AirlineTheme a getter/setter

This commit is contained in:
Bailey Ling 2013-07-11 01:40:38 +00:00
parent 6b94397105
commit 150cd09d38
2 changed files with 8 additions and 2 deletions

View File

@ -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*

View File

@ -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,<sid>get_airline_themes AirlineTheme call airline#load_theme(<f-args>)
function! s:airline_theme(...)
if a:0
call airline#load_theme(a:1)
endif
echo g:airline_theme
endfunction
command! -nargs=? -complete=customlist,<sid>get_airline_themes AirlineTheme call <sid>airline_theme(<f-args>)
augroup airline
au!