diff --git a/home-manager/features/neovim/config/lua/plugins/markdown.lua b/home-manager/features/neovim/config/lua/plugins/markdown.lua new file mode 100644 index 0000000..b7de050 --- /dev/null +++ b/home-manager/features/neovim/config/lua/plugins/markdown.lua @@ -0,0 +1,44 @@ +return { + "MeanderingProgrammer/render-markdown.nvim", + opts = { + checkbox = { + enabled = true, + render_modes = true, + unchecked = { + icon = "󰄱 ", + highlight = "RenderMarkdownUnchecked", + scope_highlight = nil, + }, + checked = { + -- Replaces '[x]' of 'task_list_marker_checked'. + icon = "󰱒 ", + -- Highlight for the checked icon. + highlight = "RenderMarkdownChecked", + -- Highlight for item associated with checked checkbox. + scope_highlight = nil, + }, + -- Define custom checkbox states, more involved, not part of the markdown grammar. + -- As a result this requires neovim >= 0.10.0 since it relies on 'inline' extmarks. + -- 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' | + -- | rendered | replaces the 'raw' value when rendering | + -- | highlight | highlight for the 'rendered' icon | + -- | scope_highlight | optional highlight for item associated with custom checkbox | + -- stylua: ignore + custom = { + partial = { + raw = '[/]', + rendered = '⛋ ', + highlight = 'RenderMarkdownTodo', + scope_highlight = nil + }, + deferred = { + raw = '[>]', + rendered = '⛝ ', + highlight = 'RenderMarkdownWarn', + scope_highlight = nil + }, + }, + }, + }, +} diff --git a/home-manager/features/neovim/config/lua/plugins/obsidian.lua b/home-manager/features/neovim/config/lua/plugins/obsidian.lua index 8c59bf4..9fc3d83 100644 --- a/home-manager/features/neovim/config/lua/plugins/obsidian.lua +++ b/home-manager/features/neovim/config/lua/plugins/obsidian.lua @@ -38,6 +38,13 @@ return { ui = { -- Disable the UI features and let render-markdown.nvim handle it. enable = false, + -- Even with UI disabled, this determines the order of checkbox states for the smart action. + checkboxes = { + [" "] = { char = "☐", hl_group = "ObsidianTodo" }, + ["x"] = { char = "✔", hl_group = "ObsidianDone" }, + ["/"] = { char = "⛋", hl_group = "ObsidianDone" }, + [">"] = { char = "⛝", hl_group = "ObsidianDone" }, + }, }, }, }