Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(markdown): add markdown-preview.nvim. #1152

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lua/astrocommunity/pack/markdown/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ This plugin pack does the following:
- Adds `markdown` and `markdown_inline` Treesitter parsers
- Adds `marksman` language server
- Adds `prettierd` formatter
- Adds `markdown-preview.nvim` for real-time preview.
17 changes: 17 additions & 0 deletions lua/astrocommunity/pack/markdown/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,21 @@ return {
},
},
},
{
-- Install markdown preview, use npx if available.
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown" },
build = function(plugin)
if vim.fn.executable "npx" then
vim.cmd("!cd " .. plugin.dir .. " && cd app && npx --yes yarn install")
else
vim.cmd [[Lazy load markdown-preview.nvim]]
vim.fn["mkdp#util#install"]()
end
end,
init = function()
if vim.fn.executable "npx" then vim.g.mkdp_filetypes = { "markdown" } end
end,
},
}
Loading