maxmx03.solarized.nvim/lua/solarized/init.lua
Max Miliano 10eb62fe0f
Some checks are pending
Test / lint (push) Waiting to run
Test / pandoc to vimdoc (push) Waiting to run
fix: selenized and solarized extra colors
feat: annotation for config
refactor: search,incsearch,border
2024-08-24 15:27:47 -03:00

41 lines
927 B
Lua

---@class solarized
---@field config? solarized.config
---@field setup? fun(config: solarized.config)
---@field load? fun()
---@type solarized
local M = {}
M.config = require 'solarized.config'
M.setup = function(config)
M.config = vim.tbl_deep_extend('force', M.config, config)
end
M.load = function()
if vim.g.colors_name then
vim.cmd 'hi clear'
end
if vim.fn.exists 'syntax_on' then
vim.cmd 'syntax reset'
end
vim.g.colors_name = 'solarized'
local highlights = {}
local colors = {}
if vim.o.background == 'dark' then
highlights = require 'solarized.highlights'
local palette = require 'solarized.palette'
colors = palette[M.config.palette]
else
highlights = require 'solarized.highlights.solarized-light'
local palette = require 'solarized.palette.solarized-light'
colors = palette[M.config.palette]
end
highlights.set_highlight(colors, M.config)
end
return M