Add config field to disable bold styles across the whole theme

This commit is contained in:
Kacper Hemperek
2025-05-21 09:18:51 +02:00
parent f7080992e7
commit aaa72b68b6
6 changed files with 624 additions and 550 deletions
+40 -13
View File
@@ -11,9 +11,9 @@ function M.setup(colors, config)
-- ColorColumn Used for the columns set with 'colorcolumn'.
ColorColumn = { bg = theme.ui.bg_p1 },
-- Conceal Placeholder characters substituted for concealed text (see 'conceallevel').
Conceal = { fg = theme.ui.special, bold = true },
Conceal = { fg = theme.ui.special, bold = config.bold },
-- CurSearch Used for highlighting a search pattern under the cursor (see 'hlsearch').
CurSearch = { fg = theme.ui.fg, bg = theme.ui.bg_search, bold = true },
CurSearch = { fg = theme.ui.fg, bg = theme.ui.bg_search, bold = config.bold },
-- Cursor Character under the cursor.
Cursor = { fg = theme.ui.cursor_fg, bg = theme.ui.cursor_bg },
-- lCursor Character under the cursor when |language-mapping| is used (see 'guicursor').
@@ -62,11 +62,11 @@ function M.setup(colors, config)
-- CursorLineFold Like FoldColumn when 'cursorline' is set for the cursor line.
-- CursorLineSign Like SignColumn when 'cursorline' is set for the cursor line.
-- MatchParen Character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt|
MatchParen = { fg = theme.diag.warning, bold = true },
MatchParen = { fg = theme.diag.warning, bold = config.bold },
-- ModeMsg 'showmode' message (e.g., "-- INSERT --").
ModeMsg = { fg = theme.diag.warning, bold = true },
ModeMsg = { fg = theme.diag.warning, bold = config.bold },
-- MsgArea Area for messages and cmdline.
MsgArea = vim.o.cmdheight == 0 and { link = 'StatusLine' } or { fg = theme.ui.fg_dim },
MsgArea = vim.o.cmdheight == 0 and { link = "StatusLine" } or { fg = theme.ui.fg_dim },
-- MsgSeparator Separator for scrolled messages |msgsep|.
MsgSeparator = { bg = vim.o.cmdheight == 0 and theme.ui.bg or theme.ui.bg_m3 },
-- MoreMsg |more-prompt|
@@ -78,9 +78,16 @@ function M.setup(colors, config)
-- NormalFloat Normal text in floating windows.
NormalFloat = { fg = theme.ui.float.fg, bg = config.transparent and theme.ui.none or theme.ui.float.bg },
-- FloatBorder Border of floating windows.
FloatBorder = { fg = theme.ui.float.fg_border, bg = config.transparent and theme.ui.none or theme.ui.float.bg_border },
FloatBorder = {
fg = theme.ui.float.fg_border,
bg = config.transparent and theme.ui.none or theme.ui.float.bg_border,
},
-- FloatTitle Title of floating windows.
FloatTitle = { fg = theme.ui.special, bg = config.transparent and theme.ui.none or theme.ui.float.bg_border, bold = true },
FloatTitle = {
fg = theme.ui.special,
bg = config.transparent and theme.ui.none or theme.ui.float.bg_border,
bold = config.bold,
},
-- FloatFooter Footer of floating windows.
FloatFooter = { fg = theme.ui.nontext, bg = config.transparent and theme.ui.none or theme.ui.float.bg_border },
-- NormalNC Normal text in non-current windows.
@@ -126,9 +133,13 @@ function M.setup(colors, config)
-- TabLineFill Tab pages line, where there are no labels.
TabLineFill = { bg = theme.ui.none },
-- TabLineSel Tab pages line, active tab page label.
TabLineSel = { fg = theme.ui.fg_dim, bg = not config.transparent and theme.ui.bg_p1 or theme.ui.none, bold = true },
TabLineSel = {
fg = theme.ui.fg_dim,
bg = not config.transparent and theme.ui.bg_p1 or theme.ui.none,
bold = config.bold,
},
-- Title Titles for output from ":set all", ":autocmd" etc.
Title = { fg = theme.syn.fun, bold = true },
Title = { fg = theme.syn.fun, bold = config.bold },
-- Visual Visual mode selection.
Visual = { bg = theme.ui.bg_visual },
-- VisualNOS Visual mode selection when vim is "Not Owning the Selection".
@@ -177,10 +188,26 @@ function M.setup(colors, config)
DiagnosticVirtualTextInfo = { link = "DiagnosticInfo" },
DiagnosticVirtualTextHint = { link = "DiagnosticHint" },
DiagnosticUnderlineError = { undercurl = config.undercurl, underline = not config.undercurl, sp = theme.diag.error },
DiagnosticUnderlineWarn = { undercurl = config.undercurl, underline = not config.undercurl, sp = theme.diag.warning },
DiagnosticUnderlineInfo = { undercurl = config.undercurl, underline = not config.undercurl, sp = theme.diag.info },
DiagnosticUnderlineHint = { undercurl = config.undercurl, underline = not config.undercurl, sp = theme.diag.hint },
DiagnosticUnderlineError = {
undercurl = config.undercurl,
underline = not config.undercurl,
sp = theme.diag.error,
},
DiagnosticUnderlineWarn = {
undercurl = config.undercurl,
underline = not config.undercurl,
sp = theme.diag.warning,
},
DiagnosticUnderlineInfo = {
undercurl = config.undercurl,
underline = not config.undercurl,
sp = theme.diag.info,
},
DiagnosticUnderlineHint = {
undercurl = config.undercurl,
underline = not config.undercurl,
sp = theme.diag.hint,
},
LspSignatureActiveParameter = { fg = theme.diag.warning },
LspCodeLens = { fg = theme.syn.comment },
+4 -4
View File
@@ -12,15 +12,15 @@ function M.setup(colors, config)
-- ["@lsp.type.function"] = { link = "Function" },
-- ["@lsp.type.interface"] = { link = "Structure" },
["@lsp.type.macro"] = { link = "Macro" },
["@lsp.type.method"] = { link = "@function.method" }, -- Function
["@lsp.type.namespace"] = { link = "@module" }, -- Structure
["@lsp.type.method"] = { link = "@function.method" }, -- Function
["@lsp.type.namespace"] = { link = "@module" }, -- Structure
["@lsp.type.parameter"] = { link = "@variable.parameter" }, -- Identifier
-- ["@lsp.type.property"] = { link = "Identifier" },
-- ["@lsp.type.struct"] = { link = "Structure" },
-- ["@lsp.type.type"] = { link = "Type" },
-- ["@lsp.type.typeParameter"] = { link = "TypeDef" },
["@lsp.type.variable"] = { fg = "none" }, -- Identifier
["@lsp.type.comment"] = { link = "Comment" }, -- Comment
["@lsp.type.comment"] = { link = "Comment" }, -- Comment
["@lsp.type.const"] = { link = "Constant" },
["@lsp.type.comparison"] = { link = "Operator" },
@@ -52,7 +52,7 @@ function M.setup(colors, config)
["@lsp.typemod.variable.injected"] = { link = "@variable" },
["@lsp.typemod.function.readonly"] = { fg = theme.syn.fun, bold = true },
["@lsp.typemod.function.readonly"] = { fg = theme.syn.fun, bold = config.bold },
}
end
File diff suppressed because it is too large Load Diff
+12 -6
View File
@@ -9,8 +9,11 @@ function M.setup(colors, config)
return {
-- *Comment any comment
Comment = vim.tbl_extend("force", { fg = theme.syn.comment }, config.disableItalics and {} or config
.commentStyle),
Comment = vim.tbl_extend(
"force",
{ fg = theme.syn.comment },
config.disableItalics and {} or config.commentStyle
),
-- *Constant any constant
Constant = { fg = theme.syn.constant },
@@ -38,8 +41,11 @@ function M.setup(colors, config)
-- Operator "sizeof", "+", "*", etc.
Operator = { fg = theme.syn.operator },
-- Keyword any other keyword
Keyword = vim.tbl_extend("force", { fg = theme.syn.keyword }, config.disableItalics and {} or config
.keywordStyle),
Keyword = vim.tbl_extend(
"force",
{ fg = theme.syn.keyword },
config.disableItalics and {} or config.keywordStyle
),
-- Exception try, catch, throw
Exception = { fg = theme.syn.special2 },
@@ -67,7 +73,7 @@ function M.setup(colors, config)
-- *Underlined text that stands out, HTML links
Underlined = { fg = theme.syn.special1, underline = true },
Bold = { bold = true },
Bold = { bold = config.bold },
Italic = { italic = not config.disableItalics },
-- *Ignore left blank, hidden |hl-Ignore|
@@ -77,7 +83,7 @@ function M.setup(colors, config)
Error = { fg = theme.diag.error },
-- *Todo anything that needs extra attention; mostly the keywords TODO FIXME WARNING and XXX
Todo = { fg = theme.ui.fg_reverse, bg = theme.diag.info, bold = true },
Todo = { fg = theme.ui.fg_reverse, bg = theme.diag.info, bold = config.bold },
qfLineNr = { link = "lineNr" },
qfFileName = { link = "Directory" },
+9 -6
View File
@@ -77,8 +77,11 @@ function M.setup(colors, config)
-- @keyword.modifier keywords defining type modifiers (e.g. `const`, `static`, `public`)
-- @keyword.repeat keywords related to loops (e.g. `for`, `while`)
-- @keyword.return keywords like `return` and `yield`
["@keyword.return"] = vim.tbl_extend("force", { fg = theme.syn.special3 },
config.disableItalics and {} or config.keywordStyle),
["@keyword.return"] = vim.tbl_extend(
"force",
{ fg = theme.syn.special3 },
config.disableItalics and {} or config.keywordStyle
),
-- @keyword.debug keywords related to debugging
-- @keyword.exception keywords related to exceptions (e.g. `throw`, `catch`)
["@keyword.exception"] = vim.tbl_extend("force", { fg = theme.syn.special3 }, config.statementStyle),
@@ -102,15 +105,15 @@ function M.setup(colors, config)
-- @comment.documentation comments documenting code
--
-- @comment.error error-type comments (e.g. `ERROR`, `FIXME`, `DEPRECATED`)
["@comment.error"] = { fg = theme.ui.fg, bg = theme.diag.error, bold = true },
["@comment.error"] = { fg = theme.ui.fg, bg = theme.diag.error, bold = config.bold },
-- @comment.warning warning-type comments (e.g. `WARNING`, `FIX`, `HACK`)
["@comment.warning"] = { fg = theme.ui.fg_reverse, bg = theme.diag.warning, bold = true },
["@comment.warning"] = { fg = theme.ui.fg_reverse, bg = theme.diag.warning, bold = config.bold },
-- @comment.todo todo-type comments (e.g. `TODO`, `WIP`)
-- @comment.note note-type comments (e.g. `NOTE`, `INFO`, `XXX`)
["@comment.note"] = { fg = theme.ui.fg_reverse, bg = theme.diag.hint, bold = true },
["@comment.note"] = { fg = theme.ui.fg_reverse, bg = theme.diag.hint, bold = config.bold },
--
-- @markup.strong bold text
["@markup.strong"] = { bold = true },
["@markup.strong"] = { bold = config.bold },
-- @markup.italic italic text
["@markup.italic"] = { italic = true },
-- @markup.strikethrough struck-through text