From 150cd09d38ca723edd61862d2d164b55e5c30677 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Thu, 11 Jul 2013 01:40:38 +0000 Subject: [PATCH] make :AirlineTheme a getter/setter --- doc/airline.txt | 2 +- plugin/airline.vim | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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!