summaryrefslogtreecommitdiffstats
path: root/.config/nvim/plugin/50-markdown.lua
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-05-07 17:15:10 +0200
committerThomas Vanbesien <tvanbesi@proton.me>2026-05-07 18:36:02 +0200
commitf2c4081c9251e6f688c206bb90c8f646daaa640c (patch)
treeef5f5c70d38d0ad21135f784904c670462a17641 /.config/nvim/plugin/50-markdown.lua
parenta8e96131b873729c40644c34fc7ac060aa50168c (diff)
downloaddotfiles-f2c4081c9251e6f688c206bb90c8f646daaa640c.tar.gz
dotfiles-f2c4081c9251e6f688c206bb90c8f646daaa640c.zip
feat(nvim): add markdown rendering with `render-markdown.nvim`
See https://github.com/MeanderingProgrammer/render-markdown.nvim - Don't set `'colorcolumn'` and `'conceallevel'` in markdown ftplugin - Treesitter plugin doesn't install the markdown and markdown_inline parsers. `50-markdown.lua` does it instead, so that it is self-contained. It also installs extra parsers it needs: yaml, html and latex. - Remove markdown highlight adjustments in `50-colors.lua` - Remove `markdown/injections.scm` that was disabling treesitter highlighting inside fenced code blocks.
Diffstat (limited to '.config/nvim/plugin/50-markdown.lua')
-rw-r--r--.config/nvim/plugin/50-markdown.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/.config/nvim/plugin/50-markdown.lua b/.config/nvim/plugin/50-markdown.lua
new file mode 100644
index 0000000..d033d32
--- /dev/null
+++ b/.config/nvim/plugin/50-markdown.lua
@@ -0,0 +1,24 @@
+--
+-- Markdown rendering plugin
+--
+-- Uses `render-markdown`, see https://github.com/MeanderingProgrammer/render-markdown.nvim
+
+vim.pack.add({
+ "https://github.com/nvim-treesitter/nvim-treesitter",
+ "https://github.com/nvim-tree/nvim-web-devicons",
+ "https://github.com/MeanderingProgrammer/render-markdown.nvim",
+})
+
+require("nvim-treesitter").install({
+ "html",
+ "latex",
+ "markdown",
+ "markdown_inline",
+ "yaml",
+})
+
+require("render-markdown").setup({
+ heading = { width = "block", min_width = 120 },
+ code = { position = "center", sign = false, width = "block", min_width = 60, left_margin = 2 },
+ dash = { width = 120 },
+})