From 8595d792ec8eb1073b951b5579bd25c095cf17c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Sat, 11 Apr 2026 19:14:25 +0200 Subject: [PATCH] Continue work on nvim --- .../nvim/lua/plugins/colorizer.lua | 10 ++ .../nvim/lua/plugins/gitsigns.lua | 50 +++++++ .../nvim/lua/plugins/render-markdown.lua | 139 ++++++++++++++++++ 3 files changed, 199 insertions(+) create mode 100644 private_dot_config/nvim/lua/plugins/colorizer.lua create mode 100644 private_dot_config/nvim/lua/plugins/gitsigns.lua create mode 100644 private_dot_config/nvim/lua/plugins/render-markdown.lua diff --git a/private_dot_config/nvim/lua/plugins/colorizer.lua b/private_dot_config/nvim/lua/plugins/colorizer.lua new file mode 100644 index 0000000..a90bb2f --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/colorizer.lua @@ -0,0 +1,10 @@ +require("colorizer").setup({ "*" }, { + RGB = true, -- #RGB hex codes + RRGGBB = true, -- #RRGGBB hex codes + names = false, -- "Name" codes like Blue + RRGGBBAA = true, -- #RRGGBBAA hex codes + rgb_fn = true, -- CSS rgb() and rgba() functions + hsl_fn = true, -- CSS hsl() and hsla() functions + css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn +}) diff --git a/private_dot_config/nvim/lua/plugins/gitsigns.lua b/private_dot_config/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..c3bc80a --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,50 @@ +require('gitsigns').setup { + signs = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signs_staged = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signs_staged_enable = true, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + follow_files = true + }, + auto_attach = true, + attach_to_untracked = false, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + virt_text_priority = 100, + use_focus = true, + }, + current_line_blame_formatter = ', - ', + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + preview_config = { + -- Options passed to nvim_open_win + border = 'single', + style = 'minimal', + relative = 'cursor', + row = 0, + col = 1 + }, +} diff --git a/private_dot_config/nvim/lua/plugins/render-markdown.lua b/private_dot_config/nvim/lua/plugins/render-markdown.lua new file mode 100644 index 0000000..4a4283c --- /dev/null +++ b/private_dot_config/nvim/lua/plugins/render-markdown.lua @@ -0,0 +1,139 @@ +require('render-markdown').setup({ + link = { + -- Turn on / off inline link icon rendering. + enabled = true, + -- Additional modes to render links. + render_modes = false, + -- How to handle footnote links, start with a '^'. + footnote = { + -- Turn on / off footnote rendering. + enabled = true, + -- Replace value with superscript equivalent. + superscript = true, + -- Added before link content. + prefix = '', + -- Added after link content. + suffix = '', + }, + -- Inlined with 'image' elements. + image = '󰥶 ', + -- Inlined with 'email_autolink' elements. + email = '󰀓 ', + -- Fallback icon for 'inline_link' and 'uri_autolink' elements. + hyperlink = '󰌹 ', + -- Applies to the inlined icon as a fallback. + highlight = 'RenderMarkdownLink', + -- Applies to WikiLink elements. + wiki = { + icon = '󱗖 ', + body = function() + return nil + end, + highlight = 'RenderMarkdownWikiLink', + }, + -- Define custom destination patterns so icons can quickly inform you of what a link + -- contains. Applies to 'inline_link', 'uri_autolink', and wikilink nodes. When multiple + -- patterns match a link the one with the longer pattern is used. + -- The key is for healthcheck and to allow users to change its values, value type below. + -- | pattern | matched against the destination text | + -- | icon | gets inlined before the link text | + -- | kind | optional determines how pattern is checked | + -- | | pattern | @see :h lua-patterns, is the default if not set | + -- | | suffix | @see :h vim.endswith() | + -- | priority | optional used when multiple match, uses pattern length if empty | + -- | highlight | optional highlight for 'icon', uses fallback highlight if empty | + custom = { + web = { pattern = '^http', icon = '󰖟 ' }, + github = { pattern = 'github%.com', icon = '󰊤 ' }, + gitlab = { pattern = 'gitlab%.com', icon = '󰮠 ' }, + stackoverflow = { pattern = 'stackoverflow%.com', icon = '󰓌 ' }, + wikipedia = { pattern = 'wikipedia%.org', icon = '󰖬 ' }, + youtube = { pattern = 'youtube%.com', icon = '󰗃 ' }, + }, + }, + callout = { + -- Callouts are a special instance of a 'block_quote' that start with a 'shortcut_link'. + -- The key is for healthcheck and to allow users to change its values, value type below. + -- | raw | matched against the raw text of a 'shortcut_link', case insensitive | + -- | rendered | replaces the 'raw' value when rendering | + -- | highlight | highlight for the 'rendered' text and quote markers | + -- | quote_icon | optional override for quote.icon value for individual callout | + -- | category | optional metadata useful for filtering | + + note = { raw = '[!NOTE]', rendered = '󰋽 Note', highlight = 'RenderMarkdownInfo'}, + tip = { raw = '[!TIP]', rendered = '󰌶 Tip', highlight = 'RenderMarkdownSuccess'}, + important = { raw = '[!IMPORTANT]', rendered = '󰅾 Important', highlight = 'RenderMarkdownHint'}, + warning = { raw = '[!WARNING]', rendered = '󰀪 Warning', highlight = 'RenderMarkdownWarn'}, + caution = { raw = '[!CAUTION]', rendered = '󰳦 Caution', highlight = 'RenderMarkdownError'}, + abstract = { raw = '[!ABSTRACT]', rendered = '󰨸 Abstract', highlight = 'RenderMarkdownInfo'}, + summary = { raw = '[!SUMMARY]', rendered = '󰨸 Summary', highlight = 'RenderMarkdownInfo'}, + tldr = { raw = '[!TLDR]', rendered = '󰨸 Tldr', highlight = 'RenderMarkdownInfo'}, + info = { raw = '[!INFO]', rendered = '󰋽 Info', highlight = 'RenderMarkdownInfo'}, + todo = { raw = '[!TODO]', rendered = '󰗡 Todo', highlight = 'RenderMarkdownInfo'}, + hint = { raw = '[!HINT]', rendered = '󰌶 Hint', highlight = 'RenderMarkdownSuccess'}, + success = { raw = '[!SUCCESS]', rendered = '󰄬 Success', highlight = 'RenderMarkdownSuccess'}, + check = { raw = '[!CHECK]', rendered = '󰄬 Check', highlight = 'RenderMarkdownSuccess'}, + done = { raw = '[!DONE]', rendered = '󰄬 Done', highlight = 'RenderMarkdownSuccess'}, + question = { raw = '[!QUESTION]', rendered = '󰘥 Question', highlight = 'RenderMarkdownWarn'}, + help = { raw = '[!HELP]', rendered = '󰘥 Help', highlight = 'RenderMarkdownWarn'}, + faq = { raw = '[!FAQ]', rendered = '󰘥 Faq', highlight = 'RenderMarkdownWarn'}, + attention = { raw = '[!ATTENTION]', rendered = '󰀪 Attention', highlight = 'RenderMarkdownWarn'}, + failure = { raw = '[!FAILURE]', rendered = '󰅖 Failure', highlight = 'RenderMarkdownError'}, + fail = { raw = '[!FAIL]', rendered = '󰅖 Fail', highlight = 'RenderMarkdownError'}, + missing = { raw = '[!MISSING]', rendered = '󰅖 Missing', highlight = 'RenderMarkdownError'}, + danger = { raw = '[!DANGER]', rendered = '󱐌 Danger', highlight = 'RenderMarkdownError'}, + error = { raw = '[!ERROR]', rendered = '󱐌 Error', highlight = 'RenderMarkdownError'}, + bug = { raw = '[!BUG]', rendered = '󰨰 Bug', highlight = 'RenderMarkdownError'}, + example = { raw = '[!EXAMPLE]', rendered = '󰉹 Example', highlight = 'RenderMarkdownHint' }, + quote = { raw = '[!QUOTE]', rendered = '󱆨 Quote', highlight = 'RenderMarkdownQuote'}, + cite = { raw = '[!CITE]', rendered = '󱆨 Cite', highlight = 'RenderMarkdownQuote'}, + }, + checkbox = { + enabled = true, + render_modes = false, + bullet = false, + right_pad = 1, + unchecked = { + icon = '󰄱 ', + highlight = 'RenderMarkdownUnchecked', + scope_highlight = nil, + }, + checked = { + icon = '󰱒 ', + highlight = 'RenderMarkdownChecked', + scope_highlight = nil, + }, + custom = { + todo = { raw = '[-]', rendered = '󰥔 ', highlight = 'RenderMarkdownTodo', scope_highlight = nil }, + }, + }, + bullet = { + enabled = true, + render_modes = false, + icons = { '●', '○', '◆', '◇' }, + ordered_icons = function(ctx) + local value = vim.trim(ctx.value) + local index = tonumber(value:sub(1, #value - 1)) + return ('%d.'):format(index > 1 and index or ctx.index) + end, + left_pad = 0, + right_pad = 0, + highlight = 'RenderMarkdownBullet', + scope_highlight = {}, + }, + quote = { icon = '▋' }, + anti_conceal = { + enabled = true, + -- Which elements to always show, ignoring anti conceal behavior. Values can either be + -- booleans to fix the behavior or string lists representing modes where anti conceal + -- behavior will be ignored. Valid values are: + -- head_icon, head_background, head_border, code_language, code_background, code_border, + -- dash, bullet, check_icon, check_scope, quote, table_border, callout, link, sign + ignore = { + code_background = true, + sign = true, + }, + above = 0, + below = 0, + }, +})