Use links instead of repeating colors

This commit is contained in:
Daniel Lundin 2024-06-04 21:57:51 +02:00
parent 0d24d49e1d
commit c7fc83eaf6
No known key found for this signature in database

View file

@ -1,11 +1,12 @@
local colors = {
light = {
background = "#fefeff",
foreground = "#202020",
intense = "#000000",
primary = "#ff0000",
secondary = "#00ff00",
diagnostic_error = "#ff0038",
diagnostic_warning = "#ff7700",
diagnostic_warning = "#ffcc00",
diagnostic_info = "#47eae0",
diagnostic_hint = "#47eae0",
diff_add = "#00ff77",
@ -16,6 +17,7 @@ local colors = {
},
dark = {
background = "#000000",
foreground = "#b2b2b2",
intense = "#e7e7e7",
primary = "#00ff00",
@ -35,26 +37,34 @@ local colors = {
local c = colors[vim.o.background]
local theme = {
Constant = { fg = c.foreground },
Delimiter = { fg = c.foreground },
Identifier = { fg = c.foreground },
Normal = { fg = c.foreground },
Constant = { link = "Normal" },
Delimiter = { link = "Normal" },
Identifier = { link = "Normal" },
Normal = { fg = c.foreground, bg = c.background },
Keyword = { fg = c.foreground, bold = true },
Operator = { fg = c.foreground },
Special = { fg = c.foreground },
String = { fg = c.foreground },
Type = { fg = c.foreground },
["@function"] = { fg = c.foreground },
["@special"] = { fg = c.foreground },
["@variable"] = { fg = c.foreground },
Operator = { link = "Normal" },
Special = { link = "Normal" },
String = { link = "Normal" },
Type = { link = "Normal" },
-- Treesitter
["@function"] = { link = "Normal" },
["@special"] = { link = "Normal" },
["@variable"] = { link = "Normal" },
-- UI Elements
CursorLine = { bg = c.highlight_subtle },
DiagnosticSignError = { fg = c.diagnostic_error },
DiagnosticSignHint = { fg = c.diagnostic_hint },
DiagnosticSignInfo = { fg = c.diagnostic_info },
DiagnosticSignWarn = { fg = c.diagnostic_warning },
LineNr = { fg = c.dimmed, italic = true },
IndentLine = { fg = "#ffffff" },
IndentLineCurrent = { fg = c.dimmed },
TreesitterContext = { reverse = true },
TreesitterContextLineNumber = { bg = c.dimmed, reverse = true, italic = true },
InclineNormal = { bg = "bg" },
InclineNormalNC = { bg = "bg" },
}
vim.cmd("hi clear")