markdown-preview.nvim: E117: Unknown function: mkdp#util#install

安装插件的时候报错:

Post-update hook for markdown-preview.nvim ... Vim(return):E117: Unknown function: mkdp#util#install

vim是官网最新build的版本。https://github.com/vim/vim-win32-installer/releases 系统:win10

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 26 (10 by maintainers)

Commits related to this issue

Most upvoted comments

This may be caused by post-update hook bug of vim-plug, see https://github.com/junegunn/vim-plug/issues/964, after fixed, the following line

Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': 'markdown' }

should work fine without adding 'for': 'vim-plug'. Before fixed, I have been using

Plug 'iamcco/markdown-preview.nvim', { 'do': ':call mkdp#util#install()', 'for': 'markdown' }

which also is supposed by vim-plug to solve this problem.

Thanks! it’s works for me ~/.vimrc

" Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': 'markdown' }

then, :call mkdp#util#install()

None of the solutions above helped me, so I just switched to the second option of installing this plugin from the README — by installing npm (here I install it via nvm) and yarn:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
nvm install stable
nvm use stable
npm install -g yarn

with this line in my vim config:

Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' }

或者改成 Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}