mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
* Add MVP variant of nvim switcher * Update nvim configs * Remove config * Add migration for the new live themeing * Fix plugin * Remove theme * Update to actually work * Make it faster * Fix quirks --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
46 lines
1.1 KiB
Lua
46 lines
1.1 KiB
Lua
return {
|
|
{
|
|
name = "theme-hotreload",
|
|
dir = vim.fn.stdpath("config"),
|
|
lazy = false,
|
|
priority = 1000,
|
|
config = function()
|
|
local transparency_file = vim.fn.stdpath("config") .. "/plugin/after/transparency.lua"
|
|
|
|
vim.api.nvim_create_autocmd("User", {
|
|
pattern = "LazyReload",
|
|
callback = function()
|
|
package.loaded["plugins.theme"] = nil
|
|
|
|
vim.schedule(function()
|
|
local ok, theme_spec = pcall(require, "plugins.theme")
|
|
if not ok then
|
|
return
|
|
end
|
|
|
|
for _, spec in ipairs(theme_spec) do
|
|
if spec[1] == "LazyVim/LazyVim" and spec.opts and spec.opts.colorscheme then
|
|
local colorscheme = spec.opts.colorscheme
|
|
|
|
require("lazy.core.loader").colorscheme(colorscheme)
|
|
|
|
vim.defer_fn(function()
|
|
pcall(vim.cmd.colorscheme, colorscheme)
|
|
|
|
if vim.fn.filereadable(transparency_file) == 1 then
|
|
vim.defer_fn(function()
|
|
vim.cmd.source(transparency_file)
|
|
end, 5)
|
|
end
|
|
end, 5)
|
|
|
|
break
|
|
end
|
|
end
|
|
end)
|
|
end,
|
|
})
|
|
end,
|
|
},
|
|
}
|