mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2025-01-09 06:54:00 -05:00
30 lines
700 B
Lua
30 lines
700 B
Lua
|
local M = {}
|
||
|
|
||
|
function M.set(theme)
|
||
|
-- Reset everything
|
||
|
vim.api.nvim_command('hi clear')
|
||
|
if vim.fn.exists('syntax_on') then vim.api.nvim_command('syntax reset') end
|
||
|
vim.opt.background = 'dark'
|
||
|
|
||
|
-- Get theme specs
|
||
|
local t = require('themes.' .. theme)
|
||
|
vim.g.colors_name = theme
|
||
|
|
||
|
-- Load highlight groups
|
||
|
local async
|
||
|
async = vim.loop.new_async(vim.schedule_wrap(function()
|
||
|
t.set_vim_termcolors()
|
||
|
t.highlight_plugins()
|
||
|
t.highlight_languages()
|
||
|
t.highlight_treesitter()
|
||
|
t.highlight_lsp()
|
||
|
async:close()
|
||
|
end))
|
||
|
|
||
|
t.highlight_editor()
|
||
|
t.highlight_syntax()
|
||
|
async:send() -- Load the rest later
|
||
|
end
|
||
|
|
||
|
return M
|