Closed adelin-b closed 3 years ago
In lang#markdown
layer, the preview plugin is markdown-preview.nvim
, there should be a way to debug this plugin.
I just found this file, maybe you can use bootstrap function and set these env, then debug this plugin.
@adelin-b : the Markdown preview works just fine on my SpaceVim.
When I press SPC l p
or I run :MarkdownPreview
, the plugin opens a new tab in my browser (Firefox) showing the preview of the markdown file. It also updates itself in real-time (before I save the file!).
Have you checked your browser after running that command?
I have markdown preview on my personal vim config and it is working fine, I will investigate next time I try spacevim then if it works for others.
Hi - I can offer a fix for this.
Assuming you've followed the workaround to install MarkdownPreview from https://github.com/SpaceVim/SpaceVim/issues/4234#issuecomment-835836563
Using the config given in the iamcco/markdown-preview.nvim readme, we can see that it serves the page on localhost, on some port, and tries to open the link in our browser.
For me, the problem wasn't that the webserver wasn't running, it was that my browser wasn't automatically opening the link when MarkdownPreview
was run.
I set the following:
:let g:mkdp_echo_preview_url = 1
And clicked/copied the link from the echo'd output
Hi - I can offer a fix for this.
Assuming you've followed the workaround to install MarkdownPreview from #4234 (comment)
Using the config given in the iamcco/markdown-preview.nvim readme, we can see that it serves the page on localhost, on some port, and tries to open the link in our browser.
For me, the problem wasn't that the webserver wasn't running, it was that my browser wasn't automatically opening the link when
MarkdownPreview
was run.I set the following:
:let g:mkdp_echo_preview_url = 1
And clicked/copied the link from the echo'd output
It works. But how can we open the browser automatically? BTW, on Windows, it works well. on my MacOS, it seems that iTerm2 does not open the browser.
We can see code here: https://github.com/SpaceVim/SpaceVim/blob/26baf7c2e4ef09a282ea688c7e802c2a1bc37ce1/autoload/SpaceVim/layers/lang/markdown.vim#L126
It uses open-browser
to open browser. I can confirm that the server is launched and I can type the address manually in browser, it works correctly. But SpaceVim can not open browser automatically when I call MarkdownPreview
. And I can use :OpenBrowser xxx
to open browser.
Hmm. My neovim without SpaceVim works well...
Expected behavior, english is required
MarkdownPreview
to functionThe reproduce ways from Vim starting (Required!)
1 - simple config file
2 - Open a markdown file
3 -
SPC l p
nothing happend, no error msg nothing, same if calling:MarkdownPreview
Debug info
Please press SPC h I, debug info will be put into clipboard, then paste all content below.
Screenshots