-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
Vim:E117: Unknown function: mkdp#util#install when install by lazy.nvim #690
Comments
+1 |
Hi peeps, Seems like iamcco isn’t watching this one anymore, so it’s unlikely this will get merged here. A few of us are looking at possibly reviving the project elsewhere if there is enough interest in helping maintain it. Alternatively a couple of previous users started a new project https://github.com/jannis-baum/Vivify as a potential replacement |
Hi, before executing the functin, This is my resulting lazy configuration, that uses npx is available:
|
thanks @Kamilcuk this also worked for nixos (adding commend to allow other people to find this solution) |
Please excuse my dumb question but I'm somewhat new to LazyVim and even Neovim for that matter. In what file should I place the above configuration from @Kamilcuk ? |
This goes where ever you are specifying your plugins. So for me, that would be and the file contents would be:-
Looks like Kamilcuk might be using a single file setup so he probably has his in It all depends on what you are using and how exactly you've set it up, which is why its so hard to get good help on the topic, there are many variables. I'm using:-
If you let me know what you are using and I can be a bit more specific. Here is a screenshot of my plugins folder if that helps. |
I'm using the lazyvim "distro" w/structured setup on linux. Your fix seems to be working for me. Thanks so much for your help! |
There was an error when installing https://github.com/iamcco/markdown-preview.nvim through plugins in LazyVim through LazyExtras. This commit applies a fix found in an issue opened for the error. Related issues: iamcco/markdown-preview.nvim#690 Fixes pull request (not merged yet at time of writing): LazyVim/LazyVim#4196
Thanks so much, this works well for me. ==Yarn is needed==, make sure |
-- install markdown-preview.nvim without yarn or npm
{
'iamcco/markdown-preview.nvim',
cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' },
ft = { 'markdown' },
build = function()
vim.fn['mkdp#util#install']()
end,
}, I found I needed to run :Lazy build markdown-preview.nvim Just once before Also, I'd be keen to help @Tweekism !
|
Hey @viscount-monty, that'd be awesome. I'm actually away for a couple days attending a funeral, but if you are interested check out that Vivify project. I'm helping them out at the moment as it's seeing a lot of active development. Let me know what you think, and I'll chat more later in the week when I get back. |
This works for me, many thanks :D |
Just to add the full contents of require("config.lazy") -- already present in the default init.lua
spec = {
{
"iamcco/markdown-preview.nvim",
cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' },
ft = { 'markdown' },
build = function()
vim.cmd [[Lazy load markdown-preview.nvim]]
vim.fn['mkdp#util#install']()
end,
},
} |
@viscount-monty Hey mate, soz I've been away, things got a little busy here. I'll be at https://github.com/jannis-baum/Vivify If ya keen, drop a new thread in the discussions over there, no need to spam all the subscribers here. 😅 |
This fixed the error for me: -- install markdown-preview.nvim without yarn or npm
{
'iamcco/markdown-preview.nvim',
event = "VeryLazy",
cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' },
ft = { 'markdown' },
build = function()
vim.fn['mkdp#util#install']()
end,
}, |
There is a slight problem with this. In this config, plugin will be loaded on the VeryLazy event each time, not just when you open a markdown file or enter a cmd. I wrote a solution that respects the lazy loading of the plugin: return {
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview"},
build = function()
vim.opt.rtp:prepend(vim.fn.stdpath('data') .. '/lazy/markdown-preview.nvim')
vim.fn["mkdp#util#install"]()
end,
} |
- update nvchad config to match starter for v2.5. - fix markdown preview installation according to iamcco/markdown-preview.nvim#690 (comment)
My two cents on fixing this, while keeping the default lazy.nvim config Config for reference: return {
-- markdown preview from nvim
'iamcco/markdown-preview.nvim',
cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' },
ft = { 'markdown' },
build = function()
vim.fn['mkdp#util#install']()
end,
} The plugin will need to be loaded first, currently its tied to
Then call the
|
Describe the bug
I use lazy.nvim to install this plugin followed the instructions but it seems the build failed.
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown" },
build = function() vim.fn"mkdp#util#install" end,
config = function() vim.g.mkdp_auto_close = 1 end,
},
So i fixed it by this #691, is it the right way?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Build successfully
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: