From 7af5fca62a7c8ca581e1777d5273356260e92750 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 26 Jul 2024 15:33:43 +0200 Subject: [PATCH] nvim: Exchange headlines plugin for markdown.nvim To render markdown highlights and a few other things (list items, code blocks, callouts, etc) we switched from headlines.nvim to markdown.nvim (internally ralled render-markdown). This now also enables quick switching between showing the rendered output and raw markdown (`pp`). --- nvim/.config/nvim/lazy-lock.json | 4 ++-- nvim/.config/nvim/lua/plugins/prose.lua | 23 ++++++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 90e03e5..d2cd311 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -33,7 +33,6 @@ "git-conflict.nvim": { "branch": "main", "commit": "bfd9fe6fba9a161fc199771d85996236a0d0faad" }, "gitsigns.nvim": { "branch": "main", "commit": "0b04035bb7b3c83e999b9676e2fb46fd0aa9f910" }, "glance.nvim": { "branch": "master", "commit": "51059bcf21016387b6233c89eed220cf47fca752" }, - "headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" }, "image.nvim": { "branch": "master", "commit": "da64ce69598875c9af028afe129f916b02ccc42e" }, "img-clip.nvim": { "branch": "main", "commit": "fc30500c35663aa1762697f5aba31d43b86028f0" }, "jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" }, @@ -76,6 +75,7 @@ "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "quarto-nvim": { "branch": "main", "commit": "09fabb62d414e56ee3245c558aaedbdc662b6493" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "12b1a1e095d968887a17ef791c2edb78d7595d46" }, + "render-markdown": { "branch": "main", "commit": "3578523f497a8ad3b4a356d1e54e609838ce0922" }, "smartcolumn.nvim": { "branch": "main", "commit": "d01b99355c7fab13233f48d0f28dc097e68a03f7" }, "stickybuf.nvim": { "branch": "master", "commit": "2160fcd536d81f5fa43f7167dba6634e814e3154" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, @@ -95,4 +95,4 @@ "wrapping.nvim": { "branch": "master", "commit": "3a823200c297885b70515fa8d974e1763c578e26" }, "zen-mode.nvim": { "branch": "main", "commit": "04b52674b8c800f8b7d4609e8bd8d0212e3ffa79" }, "zk-nvim": { "branch": "main", "commit": "66b9b490e930fb77f93a2a0c64e0da9a5144fd0a" } -} \ No newline at end of file +} diff --git a/nvim/.config/nvim/lua/plugins/prose.lua b/nvim/.config/nvim/lua/plugins/prose.lua index 8be45c7..6b3d398 100644 --- a/nvim/.config/nvim/lua/plugins/prose.lua +++ b/nvim/.config/nvim/lua/plugins/prose.lua @@ -40,12 +40,24 @@ local prose_plugs = { }, }, }, - -- displays prettier headlines mimicking the ones in emacs orgmode + -- displays prettier md rendering { - "lukas-reineke/headlines.nvim", - dependencies = "nvim-treesitter/nvim-treesitter", - config = true, + "MeanderingProgrammer/markdown.nvim", + main = "render-markdown", + opts = {}, + name = "render-markdown", -- Only needed if you have another plugin named markdown.nvim + dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, -- if you prefer nvim-web-devicons ft = writing_ft, + keys = { + { + "pp", + function() + require("render-markdown").toggle() + end, + silent = true, + desc = "toggle md rendering", + }, + }, }, -- generate an auto-updating html preview for md files -- uses the very nice peek if deno is available, otherwise falls back to markdown-preview @@ -84,7 +96,7 @@ local prose_plugs = { }, cmd = { "PasteImage" }, keys = { - { "pp", "PasteImage", desc = "Paste image from system clipboard" }, + { "pi", "PasteImage", desc = "Paste image from system clipboard" }, }, ft = writing_ft, }, @@ -184,6 +196,7 @@ local prose_plugs = { "barreiroleo/ltex_extra.nvim", branch = "dev", }, + { "let-def/texpresso.vim", ft = { "tex" } }, } return prose_plugs