Skip to content

Commit 9625af1

Browse files
committed
feat(highlight): support render-markdown.nvim
- Add support for render-markdown.nvim - Improved diagnostics highlights
1 parent b6c46f8 commit 9625af1

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

lua/modus-themes/colors.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ M.modus_vivendi = {
295295
-- Nuanced can be combined with corresponding foreground ie. bg_red_nuanced with red
296296
bg_red_nuanced = "#2c0614",
297297
bg_green_nuanced = "#001904",
298-
bg_yellow_nuanced = "#221000",
298+
bg_yellow_nuanced = "#222000",
299299
bg_blue_nuanced = "#0f0e39",
300300
bg_magenta_nuanced = "#230631",
301301
bg_cyan_nuanced = "#041529",
@@ -455,7 +455,8 @@ function M.setup(opts)
455455
colors.error = colors.red_cooler
456456
colors.warning = colors.yellow_cooler
457457
colors.info = colors.blue_cooler
458-
colors.hint = colors.cyan_cooler
458+
colors.hint = colors.cyan_faint
459+
colors.ok = colors.green_cooler
459460
colors.success = colors.fg_added
460461
colors.visual = colors.bg_magenta_intense
461462
colors.accent_light = colors.blue_faint

lua/modus-themes/theme.lua

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ function M.setup()
154154
markdownCode = { fg = c.cyan_cooler },
155155
markdownCodeBlock = { fg = c.cyan_cooler },
156156
markdownLinkText = { fg = c.blue, underline = true },
157-
markdownH1 = { fg = c.blue, bold = true },
158-
markdownH2 = { fg = c.yellow, bold = true },
159-
markdownH3 = { fg = c.magenta, bold = true },
160-
markdownH4 = { fg = c.green, bold = true },
161-
markdownH5 = { fg = c.red, bold = true },
162-
markdownH6 = { fg = c.cyan_warmer, bold = true },
157+
markdownH1 = { link = "@markup.heading.1" },
158+
markdownH2 = { link = "@markup.heading.2" },
159+
markdownH3 = { link = "@markup.heading.3" },
160+
markdownH4 = { link = "@markup.heading.4" },
161+
markdownH5 = { link = "@markup.heading.5" },
162+
markdownH6 = { link = "@markup.heading.6" },
163163

164164
-- These groups are for the native LSP client. Some other LSP clients may
165165
-- use these groups, or use their own. Consult your LSP client's
@@ -177,17 +177,20 @@ function M.setup()
177177
DiagnosticWarn = { fg = c.warning, bold = true }, -- Used as the base highlight group. Other Diagnostic highlights link to this by default.
178178
DiagnosticInfo = { fg = c.info, bold = true }, -- Used as the base highlight group. Other Diagnostic highlights link to this by default.
179179
DiagnosticHint = { fg = c.hint, bold = true }, -- Used as the base highlight group. Other Diagnostic highlights link to this by default.
180+
DiagnosticOk = { fg = c.ok, bold = true }, -- Used as the base highlight group. Other Diagnostic highlights link to this by default.
180181
DiagnosticUnnecessary = { fg = c.fg_dim }, -- Used as the base highlight group. Other Diagnostic highlights link to this by default.
181182

182183
DiagnosticVirtualTextError = { fg = c.error, bold = true }, -- Used for "Error" diagnostic virtual text.
183184
DiagnosticVirtualTextWarn = { fg = c.warning, bold = true }, -- Used for "Warning" diagnostic virtual text.
184185
DiagnosticVirtualTextInfo = { fg = c.info, bold = true }, -- Used for "Information" diagnostic virtual text.
185186
DiagnosticVirtualTextHint = { fg = c.hint, bold = true }, -- Used for "Hint" diagnostic virtual text.
187+
DiagnosticVirtualTextOk = { fg = c.ok, bold = true }, -- Used for "Ok" diagnostic virtual text.
186188

187189
DiagnosticUnderlineError = { undercurl = true, sp = c.error }, -- Used to underline "Error" diagnostics.
188190
DiagnosticUnderlineWarn = { undercurl = true, sp = c.warning }, -- Used to underline "Warning" diagnostics.
189191
DiagnosticUnderlineInfo = { undercurl = true, sp = c.info }, -- Used to underline "Information" diagnostics.
190192
DiagnosticUnderlineHint = { undercurl = true, sp = c.hint }, -- Used to underline "Hint" diagnostics.
193+
DiagnosticUnderlineOk = { undercurl = true, sp = c.ok }, -- Used to underline "Ok" diagnostics.
191194

192195
ALEErrorSign = { fg = c.error, bold = true },
193196
ALEWarningSign = { fg = c.warning, bold = true },
@@ -852,6 +855,22 @@ function M.setup()
852855
IblIndent = { fg = c.fg_dim, nocombine = true },
853856
IblScope = { fg = c.magenta_cooler, nocombine = true },
854857

858+
-- render-markdown.nvim
859+
RenderMarkdownCodeInline = { link = "markdownCode" },
860+
RenderMarkdownCode = { link = "markdownCodeBlock" },
861+
RenderMarkdownH1 = { link = "@markup.heading.1" },
862+
RenderMarkdownH2 = { link = "@markup.heading.2" },
863+
RenderMarkdownH3 = { link = "@markup.heading.3" },
864+
RenderMarkdownH4 = { link = "@markup.heading.4" },
865+
RenderMarkdownH5 = { link = "@markup.heading.5" },
866+
RenderMarkdownH6 = { link = "@markup.heading.6" },
867+
RenderMarkdownH1Bg = { fg = c.blue, bg = c.bg_blue_nuanced },
868+
RenderMarkdownH2Bg = { fg = c.yellow, bg = c.bg_yellow_nuanced },
869+
RenderMarkdownH3Bg = { fg = c.magenta, bg = c.bg_magenta_nuanced },
870+
RenderMarkdownH4Bg = { fg = c.green, bg = c.bg_green_nuanced },
871+
RenderMarkdownH5Bg = { fg = c.red, bg = c.bg_red_nuanced },
872+
RenderMarkdownH6Bg = { fg = c.cyan_warmer, bg = c.bg_cyan_nuanced },
873+
855874
-- snacks.nvim
856875
SnacksPicker = { link = "Normal" },
857876
SnacksPickerListCursorLine = { link = "CursorLine" },

0 commit comments

Comments
 (0)