From 348fb961215427929a6ad9fa90b50ae404fac73a Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Thu, 5 Jun 2025 15:01:31 +0900 Subject: updates --- .../TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua | 97 ++++++++++++++++------ 1 file changed, 71 insertions(+), 26 deletions(-) (limited to 'ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua') diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua index 51e3d50..8f73a06 100644 --- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua +++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua @@ -142,6 +142,13 @@ return { ---@module 'render-markdown' ---@type render.md.UserConfig opts = {}, + init = function() + local wk = require("which-key") + wk.add({ + mode = { "n", "v" }, + { "mr", group = "Markdown render" }, + }) + end, config = function() -- require("obsidian").get_client().opts.ui.enable = false -- vim.api.nvim_buf_clear_namespace(0, vim.api.nvim_get_namespaces()["ObsidianUI"], 0, -1) @@ -165,32 +172,65 @@ return { end, }) vim.treesitter.language.register("markdown", "vimwiki") - - vim.keymap.set("n", "mrt", function() - require("render-markdown").buf_toggle() - end, { desc = "Toggle render-markdown" }) - vim.keymap.set("n", "mre", function() - require("render-markdown").buf_enable() - end, { desc = "Enable render-markdown" }) - vim.keymap.set("n", "mrx", function() - require("render-markdown").buf_disable() - end, { desc = "Disable render-markdown" }) - vim.keymap.set("n", "mr+", function() - require("render-markdown").expand() - end, { desc = "Expand conceal margin" }) - vim.keymap.set("n", "mr-", function() - require("render-markdown").contract() - end, { desc = "Contract conceal margin" }) - vim.keymap.set("n", "mrl", function() - require("render-markdown").log() - end, { desc = "Open render-markdown log" }) - vim.keymap.set("n", "mrc", function() - require("render-markdown").config() - end, { desc = "Show render-markdown config diff" }) - vim.keymap.set("n", "mrd", function() - require("render-markdown").debug() - end, { desc = "Debug render-markdown marks" }) end, + keys = { + { + "mrt", + function() + require("render-markdown").buf_toggle() + end, + desc = "Toggle render-markdown", + }, + { + "mre", + function() + require("render-markdown").buf_enable() + end, + desc = "Enable render-markdown", + }, + { + "mrx", + function() + require("render-markdown").buf_disable() + end, + desc = "Disable render-markdown", + }, + { + "mr+", + function() + require("render-markdown").expand() + end, + desc = "Expand conceal margin", + }, + { + "mr-", + function() + require("render-markdown").contract() + end, + desc = "Contract conceal margin", + }, + { + "mrl", + function() + require("render-markdown").log() + end, + desc = "Open render-markdown log", + }, + { + "mrc", + function() + require("render-markdown").config() + end, + desc = "Show render-markdown config diff", + }, + { + "mrd", + function() + require("render-markdown").debug() + end, + desc = "Debug render-markdown marks", + }, + }, }, { -- Install markdown preview, use npx if available. @@ -249,8 +289,13 @@ return { }, { "ellisonleao/glow.nvim", - config = true, cmd = "Glow", + config = function() + require("glow").setup({ + border = "single", -- floating window border config + style = "dark", -- filled automatically with your current editor background, you can override using glow json style + }) + end, keys = { { "mf", "Glow", desc = "Floating markdown preview" }, }, -- cgit v1.2.3