2021-11-11 15:08:59 +08:00
|
|
|
if vim.g.colors_name then
|
|
|
|
|
vim.api.nvim_command [[highlight clear]]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
vim.g.colors_name = "randombones"
|
|
|
|
|
|
2021-12-02 18:51:03 +08:00
|
|
|
local util = require "zenbones.util"
|
|
|
|
|
local colorschemes = util.get_colorscheme_list()
|
2021-11-11 15:08:59 +08:00
|
|
|
|
|
|
|
|
math.randomseed(os.time())
|
|
|
|
|
local index = math.random(#colorschemes)
|
|
|
|
|
local colorscheme = colorschemes[index]
|
|
|
|
|
|
|
|
|
|
vim.g.randombones_colors_name = colorscheme.name
|
|
|
|
|
|
|
|
|
|
if colorscheme.background then
|
|
|
|
|
vim.opt.background = colorscheme.background
|
|
|
|
|
end
|
|
|
|
|
|
2021-12-02 18:51:03 +08:00
|
|
|
util.apply_colorscheme()
|