From a31276bcddf051a07a99f84c1c0cf66320277402 Mon Sep 17 00:00:00 2001 From: MaasOedipa Date: Thu, 18 Dec 2025 14:24:13 +0100 Subject: [PATCH] render markdown added + keybinds for rendermarkdown in init.lua --- init.lua | 16 ++++++++++++++++ lua/custom/plugins/render-markdown.lua | 11 +++++++++++ 2 files changed, 27 insertions(+) create mode 100644 lua/custom/plugins/render-markdown.lua diff --git a/init.lua b/init.lua index e800f685..bccb0635 100644 --- a/init.lua +++ b/init.lua @@ -103,6 +103,22 @@ vim.keymap.set('n', 'tw', function() print('Wrap ' .. (vim.wo.wrap and 'enabled' or 'disabled')) end, { desc = 'Toggle line wrap' }) +vim.keymap.set('n', 'tr', function() + -- Ensure line wrapping is enabled + if vim.bo.filetype ~= 'markdown' then + return + end + + vim.opt_local.wrap = true + vim.opt_local.linebreak = true + + -- Toggle RenderMarkdown + vim.cmd 'RenderMarkdown toggle' + + print 'RenderMarkdown enabled with line wrap' +end, { desc = 'Toggle RenderMarkdown + enable wrap' }) + +vim.keymap.set('n', 'tp', 'RenderMarkdown preview', { desc = 'Toggle Render md preview' }) -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` diff --git a/lua/custom/plugins/render-markdown.lua b/lua/custom/plugins/render-markdown.lua new file mode 100644 index 00000000..0eab3f9f --- /dev/null +++ b/lua/custom/plugins/render-markdown.lua @@ -0,0 +1,11 @@ +return { + 'MeanderingProgrammer/render-markdown.nvim', + dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.nvim' }, -- if you use the mini.nvim suite + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.icons' }, -- if you use standalone mini plugins + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons + ---@module 'render-markdown' + ---@type render.md.UserConfig + opts = { + render_modes = {}, + }, +}