perf: remove async loading
This commit is contained in:
parent
825936964b
commit
6e1d4c2f37
@ -1,9 +1,9 @@
|
|||||||
" clear cache so this reloads changes.
|
" clear cache so this reloads changes.
|
||||||
" useful for development
|
" useful for development
|
||||||
lua package.loaded['tokyonight'] = nil
|
" lua package.loaded['tokyonight'] = nil
|
||||||
lua package.loaded['tokyonight.theme'] = nil
|
" lua package.loaded['tokyonight.theme'] = nil
|
||||||
lua package.loaded['tokyonight.colors'] = nil
|
" lua package.loaded['tokyonight.colors'] = nil
|
||||||
lua package.loaded['tokyonight.util'] = nil
|
" lua package.loaded['tokyonight.util'] = nil
|
||||||
lua package.loaded['tokyonight.config'] = nil
|
" lua package.loaded['tokyonight.config'] = nil
|
||||||
|
|
||||||
lua require('tokyonight').colorscheme()
|
lua require('tokyonight').colorscheme()
|
||||||
|
@ -223,22 +223,18 @@ end
|
|||||||
---@param theme Theme
|
---@param theme Theme
|
||||||
function util.load(theme)
|
function util.load(theme)
|
||||||
vim.cmd("hi clear")
|
vim.cmd("hi clear")
|
||||||
if vim.fn.exists("syntax_on") then
|
-- if vim.fn.exists("syntax_on") then
|
||||||
vim.cmd("syntax reset")
|
-- vim.cmd("syntax reset")
|
||||||
end
|
-- end
|
||||||
|
|
||||||
vim.o.termguicolors = true
|
vim.o.termguicolors = true
|
||||||
vim.g.colors_name = "tokyonight"
|
vim.g.colors_name = "tokyonight"
|
||||||
-- vim.api.nvim__set_hl_ns(ns)
|
-- vim.api.nvim__set_hl_ns(ns)
|
||||||
-- load base theme
|
-- load base theme
|
||||||
util.syntax(theme.base)
|
util.syntax(theme.base)
|
||||||
|
|
||||||
-- load syntax for plugins and terminal async
|
|
||||||
vim.defer_fn(function()
|
|
||||||
util.terminal(theme.colors)
|
|
||||||
util.syntax(theme.plugins)
|
util.syntax(theme.plugins)
|
||||||
|
util.terminal(theme.colors)
|
||||||
util.autocmds(theme.config)
|
util.autocmds(theme.config)
|
||||||
end, 0)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param config Config
|
---@param config Config
|
||||||
|
Loading…
Reference in New Issue
Block a user