From 4d77db36efaf2dd07b2b047db1872da9f2c9ea6f Mon Sep 17 00:00:00 2001 From: Kyeong-mi Kim Date: Sat, 14 Oct 2023 19:11:28 +0900 Subject: [PATCH] docs: add lazy.nvim install description (#583) * docs: add lazy.nvim install description * docs: missed comma in lazy.nvim description * docs: lazy.nvim instruction, add more cmd (preview, previewStop) --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 4f589b6..e03d286 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,31 @@ Plugin 'iamcco/markdown-preview.nvim' :PluginInstall :call mkdp#util#install() ``` +Or with [lazy.nvim](https://github.com/folke/lazy.nvim): +Add this in your `init.lua or plugins.lua` + +```lua +-- install without yarn or npm +{ + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + ft = { "markdown" }, + build = function() vim.fn["mkdp#util#install"]() end, +} + +-- install with yarn or npm +{ + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + build = "cd app && yarn install", + init = function() + vim.g.mkdp_filetypes = { "markdown" } + end, + ft = { "markdown" }, +}, + +``` Or with [Packer.nvim](https://github.com/wbthomason/packer.nvim): Add this in your `init.lua or plugins.lua`