24 lines
580 B
Lua
24 lines
580 B
Lua
-- Fetch and setup colorscheme if available, otherwise just return 'default'
|
|
-- This should prevent Neovim from complaining about missing colorschemes on first boot
|
|
local function get_if_available(name, opts)
|
|
local lua_ok, colorscheme = pcall(require, name)
|
|
if lua_ok then
|
|
colorscheme.setup(opts)
|
|
return name
|
|
end
|
|
|
|
local vim_ok, _ = pcall(vim.cmd.colorscheme, name)
|
|
if vim_ok then
|
|
return name
|
|
end
|
|
|
|
return "default"
|
|
end
|
|
|
|
local colorscheme = get_if_available('dracula')
|
|
if colorscheme == "default" then
|
|
colorscheme = get_if_available('gruvbox')
|
|
end
|
|
|
|
return colorscheme
|