feat: Adds better markdown support / plugins to nvim config.

This commit is contained in:
2025-11-09 01:26:12 -05:00
parent 18fc260a75
commit 97f3047989
2 changed files with 66 additions and 21 deletions

View File

@@ -20,14 +20,31 @@ vim.pack.add({
{ src = "https://github.com/nvim-mini/mini.pick" },
{ src = "https://github.com/stevearc/oil.nvim" },
{ src = "https://github.com/neovim/nvim-lspconfig" },
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" },
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" },
{ src = "https://github.com/mason-org/mason.nvim" },
{ src = "https://github.com/nvim-lua/plenary.nvim" },
{ src = "https://github.com/ThePrimeagen/harpoon", version = "harpoon2" },
{ src = "https://github.com/ThePrimeagen/harpoon", version = "harpoon2" },
{ src = "https://github.com/christoomey/vim-tmux-navigator" },
{ src = "https://github.com/stevearc/conform.nvim" },
{ src = 'https://github.com/MeanderingProgrammer/render-markdown.nvim' },
})
require("mason").setup()
require("mason").setup({
ensure_installed = {
"bash-language-server",
"docker-language-server",
"hyprls",
"jq",
"lua-language-server",
"markdown-toc",
"markdownlint-cli2",
"marksman",
"prettier",
"shellcheck",
"tinymist",
}
})
require("mini.pick").setup()
require("oil").setup({
view_options = {
@@ -42,6 +59,34 @@ require("oil").setup({
end
}
})
require("conform").setup({
formatters = {
["markdown-toc"] = {
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,
},
["markdownlint-cli2"] = {
condition = function(_, ctx)
local diag = vim.tbl_filter(function(d)
return d.source == "markdownlint"
end, vim.diagnostic.get(ctx.buf))
return #diag > 0
end,
},
formatters_by_ft = {
["markdown"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
["markdown.mdx"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
lua = { "stulua" },
swift = { "swiftformat" },
},
}
})
require("harpoon").setup({ settings = { save_on_toggle = true, sync_on_ui_close = true } })
-- Set color scheme