iamcco / markdown-preview.nvim

markdown preview plugin for (neo)vim
MIT License
6.76k stars 280 forks source link

Support for Packer #354

Closed kdrahul closed 3 years ago

kdrahul commented 3 years ago

Hey, Now that Neovim has switched to 0.5.0. A lot of people are using packer as their package manager. So will there be support for using Markdown-Preview through packer?

I'm fairly new to lua so there's a good chance that I'm missing how to configure it. Please do update the README if packer option already exists

msricher commented 3 years ago

Hi, I just came here looking for a solution to this problem myself, and I ended up getting it working with this packer.use declaration: use {'iamcco/markdown-preview.nvim', run = [[sh -c 'cd app && yarn install']]}

kdrahul commented 3 years ago

The installation part of it works, even without the run part. But when I do :MarkdownPreview it doesn't do anything.

akash-melachuri commented 3 years ago

I had the same issue as @kdrahul, which was fixed by manually running yarn install in the directory where markdown-preview is installed by packer.

vuki656 commented 3 years ago

Had the same issue. After going into the folder manually and running yarn it produced some errors regarding not being able to get some packages.

The hacky fix was to delete yarn.lock and run yarn

marcustut commented 3 years ago

It turns out that it might be we haven't load the plugin.

just run :PackerLoad markdown-preview.nvim

then it will work

kdrahul commented 3 years ago

Nope that didn't work either. This is meant to by plug and play kinda plugin. I can make it work through npm but it kinda defeats the purpose of this plugin. So the creators might have to do a few changes for it to happen maybe.

Utkarsh-khambra commented 3 years ago

I use this in packer use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = function() vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" }, })

kdrahul commented 3 years ago

Thanks that works.

piyoki commented 2 years ago

I use this in packer use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = function() vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" }, })

Thanks that's working like charm