mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 16:41:43 +05:30
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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user