Skip to content

Commit 49985de

Browse files
committed
Add markdown configuration
1 parent 3f76a5b commit 49985de

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
return {
2+
3+
-- Treesitter extras
4+
{
5+
"nvim-treesitter/nvim-treesitter",
6+
opts = function(_, opts)
7+
opts.ensure_installed = opts.ensure_installed or {}
8+
vim.list_extend(opts.ensure_installed, { "markdown", "markdown_inline" })
9+
end,
10+
},
11+
12+
-- Markdown preview
13+
{
14+
"iamcco/markdown-preview.nvim",
15+
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
16+
build = function()
17+
require("lazy").load({ plugins = { "markdown-preview.nvim" } })
18+
vim.fn["mkdp#util#install"]()
19+
end,
20+
keys = {
21+
{
22+
"<leader>P",
23+
ft = "markdown",
24+
"<cmd>MarkdownPreviewToggle<cr>",
25+
desc = "Markdown Preview",
26+
},
27+
},
28+
config = function()
29+
vim.cmd([[do FileType]])
30+
end,
31+
},
32+
33+
{
34+
"MeanderingProgrammer/render-markdown.nvim",
35+
opts = {
36+
code = {
37+
sign = false,
38+
width = "block",
39+
right_pad = 1,
40+
},
41+
heading = {
42+
sign = false,
43+
icons = {},
44+
},
45+
checkbox = {
46+
enabled = false,
47+
},
48+
},
49+
ft = { "markdown", "norg", "rmd", "org", "codecompanion" },
50+
config = function(_, opts)
51+
require("render-markdown").setup(opts)
52+
53+
-- Toggle render-markdown
54+
vim.keymap.set("n", "<leader>p", function()
55+
local m = require("render-markdown")
56+
if require("render-markdown.state").enabled then
57+
m.disable()
58+
vim.notify("Render Markdown disabled")
59+
else
60+
m.enable()
61+
vim.notify("Render Markdown enabled")
62+
end
63+
end, { desc = "Toggle Render Markdown" })
64+
end,
65+
},
66+
}

0 commit comments

Comments
 (0)