From 11c4cbd722aa282a2c2c117a5b82d923096dea55 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Wed, 6 Nov 2024 15:51:29 -0600 Subject: [PATCH] refactor(nvim): replace `markdown-preview.nvim` with `github-preview.nvim` --- .../.config/nvim/after/ftplugin/markdown.lua | 4 +++- .../nvim/lua/plugins/configs/markdown.lua | 21 ++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/users/price/dots/.config/nvim/after/ftplugin/markdown.lua b/users/price/dots/.config/nvim/after/ftplugin/markdown.lua index 4b124f51..955c2c98 100644 --- a/users/price/dots/.config/nvim/after/ftplugin/markdown.lua +++ b/users/price/dots/.config/nvim/after/ftplugin/markdown.lua @@ -2,8 +2,9 @@ vim.opt_local.tabstop = 2 vim.opt_local.shiftwidth = 2 vim.opt_local.textwidth = 0 -vim.keymap.set("n", "fr", "MarkdownPreview", { +vim.keymap.set("n", "fr", "GithubPreviewToggle", { buffer = true, + desc = "Preview Markdown in Browser" }) vim.keymap.set("n", "ff", function() vim.cmd("Markview hybridToggle") @@ -11,6 +12,7 @@ vim.keymap.set("n", "ff", function() vim.notify(("%s Markview Hybrid Mode"):format(hybrid_state), vim.log.levels.INFO, { title = "Markview" }) end, { buffer = true, + desc = "Toggle Markview Hybrid Mode" }) vim.keymap.set("n", "", function() diff --git a/users/price/dots/.config/nvim/lua/plugins/configs/markdown.lua b/users/price/dots/.config/nvim/lua/plugins/configs/markdown.lua index 2bec080f..dd882c40 100644 --- a/users/price/dots/.config/nvim/lua/plugins/configs/markdown.lua +++ b/users/price/dots/.config/nvim/lua/plugins/configs/markdown.lua @@ -1,10 +1,21 @@ return { { - "iamcco/markdown-preview.nvim", - cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, - ft = { "markdown" }, - build = function() - vim.fn["mkdp#util#install"]() + "wallpants/github-preview.nvim", + ft = "markdown", + cmd = { + "GithubPreviewToggle", + "GithubPreviewStart", + "GithubPreviewStop", + }, + config = function() + local gpreview = require("github-preview") + gpreview.setup({ + -- theme = { + -- "dark" + -- } + }) + end, + }, { "OXY2DEV/markview.nvim", ft = "markdown",