feat(nvim): Markdown: QoL plugins and settings

- Link creation: autocommand to add <leader>ml shortcut for converting
  selected text to link
- Formatting: Use markdown-toc to format available TOC
- LSP: Add markdown-toc & markdownlint to Mason ensure_installed
- Plugin: render-markdown.nvim with pretty colors to make Obsidian-esk
  rendering
- Plugin: bullets.nvim for easier bullet-point operations (auto indent,
  auto increment numbers, etc.)
- Chore: Move all markdown plugins to lang-markdown.lua
- Plugin: img-clip.nvim: Paste screenshots from system-clipboard to
markdown (also create store the image as webp)
- Plugin: image.nvim: Show images across neovim. Renders image tags on
markdown
This commit is contained in:
Pratik Tripathy
2025-01-06 17:04:44 +05:30
parent d4f25554e1
commit 36f9e5d0b3
5 changed files with 197 additions and 78 deletions

View File

@@ -17,7 +17,7 @@ return {
json = { "prettierd", "prettier", stop_after_first = true },
graphql = { "prettierd", "prettier", stop_after_first = true },
yaml = { "yamlfmt", "prettierd", stop_after_first = true },
markdown = { "markdownlint" },
markdown = { "markdownlint", "markdown-toc" },
lua = { "stylua" },
python = { "black" },
sh = { "shfmt", "shellharden", stop_after_first = true },
@@ -53,6 +53,16 @@ return {
"~/.config/templates/markdownlint.json",
},
},
["markdown-toc"] = {
-- Format only if TOC present in the file
condition = function(_, ctx)
for _, line in ipairs(vim.api.nvim_buf_get_lines(ctx.buf, 0, -1, false)) do
if line:find("<!%-%- toc %-%->") then
return true
end
end
end,
},
yamlfmt = {
prepend_args = {
"-formatter",