Extra Markdown highlighting for Neovim, loosely based on the checkbox styling and palette from the Obsidian Things theme.
Current scope:
- colors the whole checkbox token, including brackets, with a Things-inspired palette
- conceals checkbox tokens to symbols when a Nerd Font is available
- highlights Obsidian-style callout headers and colors the
>delimiters for the whole callout block
- [ ] to-do
- [/] incomplete
- [x] done
- [-] canceled
- [>] forwarded
- [<] scheduling
- [?] question
- [!] important
- [*] star
- ["] quote
- [l] location
- [b] bookmark
- [i] information
- [S] savings
- [I] idea
- [p] pros
- [c] cons
- [f] fire
- [k] key
- [w] win
- [u] up
- [d] down
- [D] draft pull request
- [P] open pull request
- [M] merged pull requestNested checkboxes are supported in indented lists and inside blockquotes because knapping matches the checkbox token after stripping Markdown list and blockquote prefixes.
Knapping highlights Obsidian callouts written as blockquotes with a [!TYPE] header:
> [!NOTE]
> A basic callout.
> [!TIP] Custom title
> A callout with a custom title.
> [!WARNING]
> Outer callout
> > [!QUESTION]
> > Nested calloutSupported aliases include:
noteabstract,summary,tldrinfotodotip,hintimportantsuccess,check,donequestion,help,faqwarning,caution,attentionfailure,fail,missingdanger,errorbugexamplequote,cite
GitHub alerts are supported as a documented subset:
NOTETIPIMPORTANTWARNINGCAUTION
Knapping supports nested callouts in source buffers by tracking callouts by quote depth and coloring each active > delimiter separately.
{
"YOUR_GITHUB_USER/knapping.nvim",
ft = "markdown",
opts = {
use_nerd_font = true, -- or false!
},
}vim.opt.rtp:append("~/Programming/knapping.nvim")
require("knapping").setup({
use_nerd_font = true, -- or false!
})Default configuration:
require("knapping").setup({
filetypes = { "markdown" },
use_nerd_font = false,
})Notes:
use_nerd_font = falseis the default; set it totrueexplicitly when you know your terminal or GUI font supports the glyphs you want- Nerd Font symbols are drawn as overlays, so knapping no longer needs to change window
conceallevel paletteandsymbolsare fully overridable if you want different colors or glyphs
Example override:
require("knapping").setup({
use_nerd_font = true,
palette = {
dark = {
accent = "#7aa2f7",
muted = "#6b7280",
},
},
symbols = {
incomplete = "◐",
draft_pr = "",
},
}):KnappingRefresh:KnappingEnable:KnappingDisable