Skip to content

Live Preview of mini.base16 #1045

Answered by mhanberg
mhanberg asked this question in Q&A
Jul 10, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Roger, I think I figured something out.

I have a couple autocmds in a lazy plugin (random spot that would get run on bootup) and then another file that has the palette motchvim.simple.colors.

We reset the colors module when we reload and simply setup the base16 theme again.

Thanks for the tip!

local function reload()
	package.loaded["motchvim.simple.colors"] = nil
	require("mini.base16").setup({
		palette = require("motchvim.simple.colors"),
		use_cterm = true,
	})
end
reload = vim.schedule_wrap(reload)

local augroup = vim.api.nvim_create_augroup("colorscheme_dev", { clear = true })
vim.api.nvim_create_autocmd("User", {
	pattern = "VeryLazy",
	group = augroup,
	callback = reload,
})
vim.api

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mhanberg
Comment options

Answer selected by mhanberg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants