mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 08:35:48 +02:00
enc: upgrade v2 to v2.5
This commit is contained in:
parent
68ea712b98
commit
609234c086
443 changed files with 5224 additions and 90746 deletions
102
lua/pcode/plugins/lang/markdown.lua
Normal file
102
lua/pcode/plugins/lang/markdown.lua
Normal file
|
@ -0,0 +1,102 @@
|
|||
return {
|
||||
{
|
||||
"pojokcodeid/auto-conform.nvim",
|
||||
event = "VeryLazy",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.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,
|
||||
},
|
||||
})
|
||||
vim.list_extend(opts.formatters_by_ft, {
|
||||
["markdown"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
|
||||
["markdown.mdx"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.ensure_installed, { "markdownlint-cli2", "markdown-toc" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"pojokcodeid/auto-lint.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.ensure_installed, { "markdownlint-cli2" })
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("auto-lint").setup(opts)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "marksman" })
|
||||
end,
|
||||
},
|
||||
-- Markdown preview
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
build = function()
|
||||
require("lazy").load({ plugins = { "markdown-preview.nvim" } })
|
||||
vim.fn["mkdp#util#install"]()
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>Cp",
|
||||
ft = "markdown",
|
||||
"<cmd>MarkdownPreviewToggle<cr>",
|
||||
desc = "Markdown Preview",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
vim.cmd([[do FileType]])
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
opts = {
|
||||
code = {
|
||||
sign = false,
|
||||
width = "block",
|
||||
right_pad = 1,
|
||||
},
|
||||
heading = {
|
||||
sign = false,
|
||||
icons = {},
|
||||
},
|
||||
},
|
||||
ft = { "markdown", "norg", "rmd", "org" },
|
||||
config = function(_, opts)
|
||||
require("render-markdown").setup(opts)
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>C", "", desc = " Markdown" },
|
||||
{
|
||||
"<leader>Cr",
|
||||
"<cmd>RenderMarkdown<cr>",
|
||||
desc = "Render Markdown",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue