Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for markdown.nvim | changed some native markup/down highlights TBD if final #154

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 27 additions & 8 deletions lua/nordic/groups/integrations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local M = {}
function M.get_groups()
local C = require 'nordic.colors'
local O = require('nordic.config').options
local U = require 'nordic.utils'

local G = {}

Expand Down Expand Up @@ -348,17 +349,17 @@ function M.get_groups()
G['@text.note'] = { link = 'Note' }
--- Markup
G['@markup'] = { link = '@none' }
G['@markup.emphasis'] = { italic = true }
G['@markup.emphasis'] = { fg = C.orange.base, italic = true }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see why you did this, and I think it makes it easier to edit the rendering (by making those things noticeable). However, I think it should just occur on rendered text because it is distracting otherwise.

Copy link
Contributor Author

@avih7531 avih7531 Aug 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. That might just be a personal preference, but I noticed it adds so much to a markdown if emphasis, bold, and italic are different colors. Will see if I can make it only apply to rendered text

G['@markup.environment'] = { link = 'Macro' }
G['@markup.environment.name'] = { link = 'Type' }
G['@markup.heading'] = { link = 'Title' }
G['@markup.heading.1'] = { fg = C.yellow.base, bold = true }
G['@markup.heading.2'] = { fg = C.orange.base, bold = true }
G['@markup.heading.3'] = { fg = C.magenta.base, bold = true }
G['@markup.heading.1'] = { fg = C.yellow.base }
G['@markup.heading.2'] = { fg = C.orange.base }
G['@markup.heading.3'] = { fg = C.magenta.base }
G['@markup.heading.4'] = { fg = C.green.base }
G['@markup.heading.5'] = { fg = C.blue2, italic = true }
G['@markup.heading.6'] = { fg = C.cyan.base, italic = true }
G['@markup.italic'] = { italic = true }
G['@markup.heading.5'] = { fg = C.blue2 }
G['@markup.heading.6'] = { fg = C.cyan.base }
5-pebbles marked this conversation as resolved.
Show resolved Hide resolved
G['@markup.italic'] = { fg = C.orange.base, italic = true }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as @markup.emphasis

G['@markup.list'] = { link = '@operator' }
G['@markup.list.checked'] = { link = 'Field' }
G['@markup.list.markdown'] = { fg = C.yellow.base, bold = true }
Expand All @@ -370,7 +371,7 @@ function M.get_groups()
G['@markup.math'] = { link = 'Special' }
G['@markup.raw'] = { link = 'String' }
G['@markup.raw.markdown_inline'] = { bg = C.black2, fg = C.fg }
G['@markup.strong'] = { bold = true }
G['@markup.strong'] = { fg = C.orange.base, bold = true }
Comment on lines -373 to +374
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as @markup.emphasis

G['@markup.strikethrough'] = { strikethrough = true }
G['@markup.underline'] = { underline = true }
-- TSX
Expand Down Expand Up @@ -523,6 +524,24 @@ function M.get_groups()
G.WhichKeySeperator = {}
G.WhichKeyValue = {}

-- Markdown.Nvim.
G.RenderMarkdownH1 = { link = '@markup.heading.1' }
G.RenderMarkdownH2 = { link = '@markup.heading.2' }
G.RenderMarkdownH3 = { link = '@markup.heading.3' }
G.RenderMarkdownH4 = { link = '@markup.heading.4' }
G.RenderMarkdownH5 = { link = '@markup.heading.5' }
G.RenderMarkdownH6 = { link = '@markup.heading.6' }
G.RenderMarkdownH1Bg = { bg = U.blend(C.yellow.base, C.grey0, 0.3) }
G.RenderMarkdownH2Bg = { bg = U.blend(C.orange.base, C.grey0, 0.3) }
G.RenderMarkdownH3Bg = { bg = U.blend(C.magenta.base, C.grey0, 0.3) }
G.RenderMarkdownH4Bg = { bg = U.blend(C.green.base, C.grey0, 0.3) }
G.RenderMarkdownH5Bg = { bg = U.blend(C.blue2, C.grey0, 0.3) }
G.RenderMarkdownH6Bg = { bg = U.blend(C.cyan.base, C.grey0, 0.3) }
5-pebbles marked this conversation as resolved.
Show resolved Hide resolved
G.RenderMarkdownCode = { bg = C.black2 }
G.RenderMarkdownCodeInline = { bg = C.gray1 }
G.RenderMarkdownTableHead = { fg = C.cyan.dim }
G.RenderMarkdownTableRow = { fg = C.cyan.base }

return G
end

Expand Down
4 changes: 2 additions & 2 deletions lua/nordic/groups/native.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ function M.get_groups()
G.markdownHeadingDelimiter = { link = 'mkdHeading' }
G.markdownCode = { link = 'CodeBlock' }
G.markdownCodeBlock = { link = 'CodeBlock' }
G.markdownH1 = { link = 'htmlH1' }
G.markdownH2 = { link = 'htmlH2' }
G.markdownH1 = { fg = C.yellow.base }
G.markdownH2 = { fg = C.orange.base }
5-pebbles marked this conversation as resolved.
Show resolved Hide resolved
G.markdownLinkText = { link = 'Link' }
G['@punctuation.special.markdown'] = { fg = C.orange.base, bold = true }
G['@text.todo.unchecked'] = { fg = C.blue1 } -- For brackets and parens.
Expand Down
Loading