[3/4] Refactor: init: Use async | Move theme stuff to theme.lua
third commit of refactor perf improvements due to async run packer sync if base16 not found this is not perfect error handling for initial run, but something handle require errors
This commit is contained in:
21
lua/theme.lua
Normal file
21
lua/theme.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
-- colorscheme related stuff
|
||||
vim.g.nvchad_theme = "onedark"
|
||||
|
||||
local base16
|
||||
if
|
||||
not pcall(
|
||||
function()
|
||||
base16 = require "base16"
|
||||
end
|
||||
)
|
||||
then
|
||||
return false
|
||||
else
|
||||
base16(base16.themes["onedark"], true)
|
||||
local cmd = vim.cmd
|
||||
|
||||
-- load bg color before async for smooth transition
|
||||
local background = require("themes/" .. vim.g.nvchad_theme).black
|
||||
vim.cmd("hi Normal guibg=" .. background)
|
||||
return true
|
||||
end
|
||||
Reference in New Issue
Block a user