Something went wrong. Try again.
My own personal NeoVim configuration. Powered by vim.pack and lz.n
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697local themes = { { name = "Catppuccin mocha", colorscheme = "catppuccin", before = [[ require("catppuccin").setup({ flavor = "mocha" }) ]], }, { name = "Monokai", colorscheme = "monokai" }, { name = "Neon default", colorscheme = "neon", before = [[ vim.g.neon_style = "default" ]] }, { name = "Neon dark", colorscheme = "neon", before = [[ vim.g.neon_style = "dark" ]] },}
local function run(code) if type(code) == "string" and code ~= "" then local fn = load(code) if fn then pcall(fn) end endend
local theme_plugin_names = { "catppuccin", "monokai", "neon" }
local function load_theme_plugins() local lz = require("lz.n") for _, name in ipairs(theme_plugin_names) do pcall(lz.trigger_load, name) endend
local function apply_saved_theme() local f = io.open(vim.fn.stdpath("data") .. "/themery/state.json", "r") if not f then return end local ok, data = pcall(vim.json.decode, f:read("*a")) f:close() if not ok or type(data) ~= "table" or not data.colorscheme then return end local lz = require("lz.n") pcall(lz.trigger_load, data.colorscheme) run(data.globalBeforeCode) run(data.beforeCode) if pcall(vim.cmd.colorscheme, data.colorscheme) then run(data.afterCode) run(data.globalAfterCode) return end for _, theme in ipairs(themes) do pcall(lz.trigger_load, theme.colorscheme) if pcall(vim.cmd.colorscheme, theme.colorscheme) then return end endend
vim.keymap.set("n", "<leader>mt", "<cmd>Themery<CR>", { desc = "Open Themery" })
return { { src = "https://github.com/catppuccin/nvim", name = "catppuccin", spec = { "catppuccin", colorscheme = "catppuccin", after = function() require("catppuccin").setup({ flavor = "mocha" }) end, }, }, { src = "https://github.com/tanvirtin/monokai.nvim", name = "monokai", spec = { "monokai", colorscheme = "monokai" }, }, { src = "https://github.com/rafamadriz/neon", name = "neon", spec = { "neon", colorscheme = "neon" }, }, { src = "https://github.com/zaldih/themery.nvim", name = "themery", spec = { "themery", cmd = "Themery", beforeAll = function() load_theme_plugins() apply_saved_theme() end, after = function() require("themery").setup({ themes = themes }) end, }, },}