From 9343a1e57922c22ad5fb9c72287aded32d4e1cb5 Mon Sep 17 00:00:00 2001 From: Daniel Carrillo Date: Wed, 24 Jul 2024 09:09:34 +0200 Subject: [PATCH] [neovim] Customize render-markdown --- .config/nvim/lua/core/keymaps.lua | 8 ++++++++ .config/nvim/lua/core/lazy.lua | 5 +++++ .config/nvim/lua/plugins/init.lua | 1 + .config/nvim/lua/plugins/render-markdown.lua | 5 +++++ 4 files changed, 19 insertions(+) create mode 100644 .config/nvim/lua/plugins/render-markdown.lua diff --git a/.config/nvim/lua/core/keymaps.lua b/.config/nvim/lua/core/keymaps.lua index 514b302..5ba8dd4 100644 --- a/.config/nvim/lua/core/keymaps.lua +++ b/.config/nvim/lua/core/keymaps.lua @@ -295,3 +295,11 @@ keymap( "lua require'ufo'.peekFoldedLinesUnderCursor()", vim.tbl_extend("force", opts, { desc = "Peek fold" }) ) + +-- Markdown +keymap( + "n", + "m", + ":RenderMarkdown toggle", + vim.tbl_extend("force", opts, { desc = "Toggle markdown rendering" }) +) diff --git a/.config/nvim/lua/core/lazy.lua b/.config/nvim/lua/core/lazy.lua index 531d72c..1b8c35b 100644 --- a/.config/nvim/lua/core/lazy.lua +++ b/.config/nvim/lua/core/lazy.lua @@ -249,6 +249,11 @@ require("lazy").setup({ end, ft = { "markdown" }, }, + { + "MeanderingProgrammer/markdown.nvim", + main = "render-markdown", + name = "render-markdown", + }, -- Copilot { diff --git a/.config/nvim/lua/plugins/init.lua b/.config/nvim/lua/plugins/init.lua index 60de393..29ab985 100644 --- a/.config/nvim/lua/plugins/init.lua +++ b/.config/nvim/lua/plugins/init.lua @@ -18,6 +18,7 @@ require("plugins.noice") require("plugins.trouble") require("plugins.autosave") require("plugins.markdowntoc") +require("plugins.render-markdown") require("plugins.diffview") require("plugins.align") require("plugins.ufo") diff --git a/.config/nvim/lua/plugins/render-markdown.lua b/.config/nvim/lua/plugins/render-markdown.lua new file mode 100644 index 0000000..adcb01c --- /dev/null +++ b/.config/nvim/lua/plugins/render-markdown.lua @@ -0,0 +1,5 @@ +require("render-markdown").setup({ + bullet = { + icons = { "·", "·", "·", "·" }, + }, +})