mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-27 22:31:09 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user