Integrate seamless, automatic, and persistent colorscheme switching for all neovim
plugins in my config
This commit is contained in:
parent
76a2e58ab8
commit
9c5a1479b7
7 changed files with 277 additions and 262 deletions
|
|
@ -1,30 +1,35 @@
|
|||
local theme_colors = require("ayu.colors")
|
||||
theme_colors.generate(true)
|
||||
-- These are not apart of the Ayu color theme, however, I needed these
|
||||
-- colors while still fitting in with the rest
|
||||
local ayu_turquoise = "#5CCFE6"
|
||||
local ayu_dark_blue = "#3A7BD5"
|
||||
local utils = require("utils")
|
||||
|
||||
local colors = {
|
||||
info = ayu_dark_blue,
|
||||
hint = ayu_turquoise,
|
||||
warning = theme_colors.warning,
|
||||
error = theme_colors.error,
|
||||
}
|
||||
local function setup_colors()
|
||||
-- These are not apart of the Ayu color theme, however, I needed these
|
||||
-- colors while still fitting in with the rest
|
||||
local ayu_turquoise = "#5CCFE6"
|
||||
local ayu_dark_blue = "#3A7BD5"
|
||||
|
||||
for _, highlight in ipairs({
|
||||
{ "DiagnosticUnderlineInfo", { undercurl = true, sp = colors.info } },
|
||||
{ "DiagnosticUnderlineHint", { undercurl = true, sp = colors.hint } },
|
||||
{ "DiagnosticUnderlineWarn", { undercurl = true, sp = colors.warning } },
|
||||
{ "DiagnosticUnderlineError", { undercurl = true, sp = colors.error } },
|
||||
{ "DiagnosticInfo", { fg = colors.info } },
|
||||
{ "DiagnosticHint", { fg = colors.hint } },
|
||||
{ "DiagnosticWarn", { fg = colors.warning } },
|
||||
{ "DiagnosticError", { fg = colors.error } },
|
||||
}) do
|
||||
vim.api.nvim_set_hl(0, highlight[1], highlight[2])
|
||||
local colors = {
|
||||
info = ayu_dark_blue,
|
||||
hint = ayu_turquoise,
|
||||
warning = utils.ayu_colors.warning,
|
||||
error = utils.ayu_colors.error,
|
||||
}
|
||||
|
||||
for _, highlight in ipairs({
|
||||
{ "DiagnosticUnderlineInfo", { undercurl = true, sp = colors.info } },
|
||||
{ "DiagnosticUnderlineHint", { undercurl = true, sp = colors.hint } },
|
||||
{ "DiagnosticUnderlineWarn", { undercurl = true, sp = colors.warning } },
|
||||
{ "DiagnosticUnderlineError", { undercurl = true, sp = colors.error } },
|
||||
{ "DiagnosticInfo", { fg = colors.info } },
|
||||
{ "DiagnosticHint", { fg = colors.hint } },
|
||||
{ "DiagnosticWarn", { fg = colors.warning } },
|
||||
{ "DiagnosticError", { fg = colors.error } },
|
||||
}) do
|
||||
vim.api.nvim_set_hl(0, highlight[1], highlight[2])
|
||||
end
|
||||
end
|
||||
|
||||
utils.create_user_event_cb("ColorsyncThemeChanged", setup_colors, "ColorsyncEvents")
|
||||
setup_colors()
|
||||
|
||||
local sev = vim.diagnostic.severity
|
||||
vim.diagnostic.config({
|
||||
underline = true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue