From 33955726e11186851c8a9ddde2b5119ad58af6ce Mon Sep 17 00:00:00 2001 From: Marcelo Date: Thu, 3 Apr 2025 17:24:37 -0300 Subject: Add a markdown renderer plugin. --- lua/config/plugins/notes.lua | 33 +++++++++++++++++++++++++++++++-- lua/config/plugins/treesitter.lua | 1 + 2 files changed, 32 insertions(+), 2 deletions(-) (limited to 'lua') diff --git a/lua/config/plugins/notes.lua b/lua/config/plugins/notes.lua index c374e94..57d5d24 100644 --- a/lua/config/plugins/notes.lua +++ b/lua/config/plugins/notes.lua @@ -27,9 +27,38 @@ return { vim.api.nvim_set_keymap("n", "zt", "ZkTags", opts) -- Search for the notes matching a given query. - vim.api.nvim_set_keymap("n", "zf", "ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }", opts) + vim.api.nvim_set_keymap("n", "zf", + "ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }", opts) -- Search for the notes matching the current visual selection. vim.api.nvim_set_keymap("v", "zf", ":'<,'>ZkMatch", opts) end - } + }, + + -- Plugin to improve viewing Markdown files in Neovim + { + "MeanderingProgrammer/render-markdown.nvim", + dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, + opts = {}, + config = function() + local min_width = 80 + require("render-markdown").setup({ + code = { + position = "right", + width = "block", + border = "thick", + min_width = min_width, + left_pad = 1, + right_pad = 1, + }, + completions = { lsp = { enabled = true } }, + dash = { + width = min_width, + }, + heading = { + width = "block", + min_width = min_width, + }, + }) + end, + }, } diff --git a/lua/config/plugins/treesitter.lua b/lua/config/plugins/treesitter.lua index 12306d7..5312e07 100644 --- a/lua/config/plugins/treesitter.lua +++ b/lua/config/plugins/treesitter.lua @@ -31,6 +31,7 @@ return { "http", "javascript", "json", + "latex", "lua", "make", "markdown", -- cgit v1.2.3