2021-11-07 09:30:44 +08:00
|
|
|
let s:colorschemes = json_decode(readfile(expand('<sfile>:h:h') . '/colorschemes.json'))
|
|
|
|
|
|
|
|
|
|
if has('nvim')
|
|
|
|
|
lua math.randomseed(os.time())
|
|
|
|
|
let s:index = v:lua.math.random(len(s:colorschemes)) - 1
|
|
|
|
|
else
|
|
|
|
|
let s:index = rand() % len(s:colorschemes)
|
|
|
|
|
endif
|
|
|
|
|
|
2021-11-07 10:05:17 +08:00
|
|
|
let g:randombones = s:colorschemes[s:index]
|
|
|
|
|
if exists('g:randombones.background')
|
|
|
|
|
call zenbones#setup_colorscheme(g:randombones.name, g:randombones.background)
|
2021-11-07 09:30:44 +08:00
|
|
|
else
|
2021-11-07 10:05:17 +08:00
|
|
|
call zenbones#setup_colorscheme(g:randombones.name)
|
2021-11-07 09:30:44 +08:00
|
|
|
end
|