use lua way to handle color scheme errors

04-colorscheme
christianchiarulli 2 years ago
parent 67f73b7044
commit 68de5d4fab

@ -1,8 +1,7 @@
vim.cmd [[
try
colorscheme darkplus
catch /^Vim\%((\a\+)\)\=:E185/
colorscheme default
set background=dark
endtry
]]
local colorscheme = "default"
local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
if not status_ok then
vim.notify("colorscheme " .. colorscheme .. " not found!")
return
end

Loading…
Cancel
Save