Closed StarryLeo closed 5 years ago
You can't use the mkdp#util#install
hook to update the plugin when you use lazy load. Because the plugin is not in the runtime path when you update, so the mkdp#util#install
is not exists. You have to write your own function to call the install script if you use lazy load.
Eh, I guess maybe you didn't see it clearly. I mean
Plug 'iamcco/markdown-preview.nvim', { 'do': ':call mkdp#util#install()', 'for': 'markdown', 'on': 'MarkdownPreview' }
can work well with lazy load and normally execute post-update hooks after the plugin updated, why use
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': 'markdown', 'on': 'MarkdownPreview' }
can not execute post-update hooks after the plugin updated.
And when I check the function about install. I find mkdp#util#pre_build_version() do not work with win10, it means app/bin will update after plugin updated even it do not need, You may want to add .exe
for win10
I done this to pull requests#42
OK, I got it. Thank you.
Hi, friends!
This plugin is work well after successfully installed.
" If you don't have nodejs and yarn " use pre build
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }}
But, When I use more options which vim-plug provide, like
'for'
,'on'
, it can not installed/update even I use!
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': 'markdown', 'on': 'MarkdownPreview' }
:PlugUpdate! markdown-preview.nvim
Then, I test more, I find use the vim command
:call mkdp#util#install()
can work well ! theinstall.cmd
can successfully run, and the plugin will lazy loadingPlug 'iamcco/markdown-preview.nvim', { 'do': ':call mkdp#util#install()', 'for': 'markdown', 'on': 'MarkdownPreview' }
I don not know how is work, but I think this is helpful to yours