-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
wsl2 ubuntu 20.04 markdownpreview无法启动chrome #309
Comments
你用 |
After several hours of research, I found the reason of this issue (at least for my situation). TL;DR Just try launch nvim by this command: As this plugin launches Chorme using then, cmd window will shown. If it cannot be launched, check your $PATH variable. Reference You can launch cmd.exe in WSL console means you can launch it in nvim. (how to run shell command in vim) But I tried to launch cmd.exe in nvim by command After researching, I found this is because I launched nvim by command To avoid this, run nvim by using @sectum-sempra 你试一下在nvim里直接启动cmd.exe能启动成功吗?不能的话,可能是PATH变量的问题。 |
This problem is resolved. Just try this command
|
Also:
then close WSL terminal Run Now open WSL again and $PATH is merged with Windows |
The absolute path of cmd.exe is a more stable choice in wsl.
:mess显示结果如下
[markdown-preview.nvim]: Can not open browser by using cmd.exe command
init.vim里对应部分设置如下:
let g:mkdp_preview_options = { \ 'mkit': {},
\ 'katex': {},
\ 'uml': {},
\ 'maid': {},
\ 'disable_sync_scroll': 0,
\ 'sync_scroll_type': 'middle',
\ 'hide_yaml_meta': 1,
\ 'sequence_diagrams': {},
\ 'flowchart_diagrams': {},
\ 'content_editable': v:false,
\ 'disable_filename': 0
\ }
let g:mkdp_browser = 'chrome'
let g:mkdp_filetypes = ['markdown','rmd']
let g:mkdp_auto_start = 1
let g:mkdp_command_for_global = 1
let g:mkdp_echo_preview_url = 1
let g:mkdp_open_to_the_world = 1
另外chrome已经添加到user和system的path里, 在cmd里输入chrome可以正常打开chrome
The text was updated successfully, but these errors were encountered: