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

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

Open
AndreM222 opened this issue Feb 23, 2024 · 8 comments
Open

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

AndreM222 opened this issue Feb 23, 2024 · 8 comments

Comments

@AndreM222
Copy link

AndreM222 commented Feb 23, 2024

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:

  • Beginning of problem
  1. Move files from after/plugins to lua/andrem222/plugins
  2. Restart
  • Trying to fix problem
  1. Uninstall plugin
  2. Restart computer
  3. Reinstall
  4. Get stuck in the cmd and never finish installation
  • Trying another way to fix problem
  1. Delete folder of markdown
  2. Restart computer
  3. Get back to nvim for automatic reinstallation
  4. Get stuck in cmd and never finish installation

Expected behavior
Be able to finish setup and work properly

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows
@kmoschcau
Copy link

kmoschcau commented Feb 25, 2024

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
Copy link
Author

AndreM222 commented Feb 25, 2024

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
Copy link

kunring commented Mar 3, 2024

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
Copy link
Author

AndreM222 commented Mar 7, 2024

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
Copy link

rijulkap commented Apr 2, 2024

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 added a commit to teoshibin/markdown-preview.nvim that referenced this issue Apr 24, 2024
@teoshibin
Copy link

teoshibin commented Apr 24, 2024

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
Copy link

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.

@vimfn
Copy link

vimfn commented Jun 16, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants