iamcco / markdown-preview.nvim

markdown preview plugin for (neo)vim
MIT License
6.36k stars 268 forks source link

After I moved My setup to lazy markdown didnt work #647

Open AndreM222 opened 4 months ago

AndreM222 commented 4 months ago

Describe the bug After switching to lazy it was not working. I have tried reinstalling the plugin but it gets stuck in the terminal part. I also tried just waiting for some hours, but after waiting for 2 hours nothing happened.

To Reproduce -- Code --

    -- Preview
    {
        "iamcco/markdown-preview.nvim", -- Preview Markdown
        cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
        ft = { "markdown" },
        build = function() vim.fn["mkdp#util#install"]() end,
    },

Steps to reproduce the behavior:

Expected behavior Be able to finish setup and work properly

Screenshots image

Desktop (please complete the following information):

kmoschcau commented 4 months ago

Might be part of the problem, this file seems highly sus: https://github.com/iamcco/markdown-preview.nvim/blob/master/app/install.cmd .cmd usually contains cmd.exe commands (like in .bat files). But this file has Powershell commands in it. cmd.exe and Powershell are not compatible. If this script is supposed to run Powershell commands, it needs to have a .ps1 extension instead.

Could you try to rename that file in your local copy and also change this line to say install.ps1 instead?

AndreM222 commented 4 months ago

Well, the thing is it did work before when I had some files in different folders. Now that I fully moved to lazy from my old packer setup it is not working anymore. I will try it out.

kunring commented 3 months ago

Might be part of the problem, this file seems highly sus: https://github.com/iamcco/markdown-preview.nvim/blob/master/app/install.cmd .cmd usually contains cmd.exe commands (like in .bat files). But this file has Powershell commands in it. cmd.exe and Powershell are not compatible. If this script is supposed to run Powershell commands, it needs to have a .ps1 extension instead.

The first line of the file invokes powershell with the rest of the contents of the file and exits.

AndreM222 commented 3 months ago

I still have the problem. is there any prerequisite for windows powershell? It does work if I use npm or yarn for this but I am trying to make my setup dependency free.

rijulkap commented 2 months ago

Seem to be having the same issue. The install fails as i use nvim on powershell (powershell 7.4.0 to be exact).

To bypass this i can navigate to the lazy install directory and run the markdown-preview/install.cmd using command prompt, following which the plugin works as intended. I would like to avoid doing this as i tend to run the same config on different machines and this seems to be a pretty awkward workaround.

teoshibin commented 2 months ago

Did some testing.

So I believe what actually happened is that since we set the default shell to be powershell, we have to specify the command like so .\install.cmd instead of install.cmd as the later will only work for cmd (otherwise you'll get the not found error) and the fix should work for both powershell and cmd.

domWalters commented 1 week ago

I encountered this same issue on Arch Linux.

I hadn't used this plugin in a while, and realised it wasn't working a week or two ago (running :MarkdownPreview flashed the command bar and did nothing).

I manually ran install.sh in the app directory in the plugin, and now it's fine again.

I don't know what broke this.

arnvgh commented 1 week ago

I encountered this same issue on Arch Linux.

I hadn't used this plugin in a while, and realised it wasn't working a week or two ago (running :MarkdownPreview flashed the command bar and did nothing).

I manually ran install.sh in the app directory in the plugin, and now it's fine again.

I don't know what broke this.

yea, I got it working the same way, will investigate further when I get some time.