Allow to switch to a random theme

You can now specify the special theme name `random` and vim-airline will
load a random theme from the ones installed. This works from either your
.vimrc as well as when calling `:AirlineTheme` command directly.

closes vim-airline/vim-airline-themes#170
This commit is contained in:
Christian Brabandt
2019-03-26 21:03:13 +01:00
parent a6fb6d9da0
commit 148eb6bb28
4 changed files with 35 additions and 3 deletions

View File

@@ -135,6 +135,6 @@ function! airline#util#doautocmd(event)
endfunction
function! airline#util#themes(match)
let files = split(globpath(&rtp, 'autoload/airline/themes/'.a:match.'*'), "\n")
return map(files, 'fnamemodify(v:val, ":t:r")')
let files = split(globpath(&rtp, 'autoload/airline/themes/'.a:match.'*.vim'), "\n")
return sort(map(files, 'fnamemodify(v:val, ":t:r")') + ['random'])
endfunction