Skip to content
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

bug: Not an editor command: UpdateRemotePlugins #382

Closed
3 tasks done
HawkinsT opened this issue Jan 13, 2023 · 9 comments · Fixed by #385
Closed
3 tasks done

bug: Not an editor command: UpdateRemotePlugins #382

HawkinsT opened this issue Jan 13, 2023 · 9 comments · Fixed by #385
Labels
bug Something isn't working

Comments

@HawkinsT
Copy link

Did you check docs and existing issues?

  • I have read all the lazy.nvim docs
  • I have searched the existing issues of lazy.nvim
  • I have searched the exsiting issues of plugins related to this issue

Neovim version (nvim -v)

0.9.0-dev-373+gf1b88ced0

Operating system/version

Arch Linux

Describe the bug

Using build = ":UpdateRemotePlugins" results in a build failed error: Error while parsing command line: E492: Not an editor command: UpdateRemotePlugins. For example:

{
    "wookayin/semshi",
    build = ":UpdateRemotePlugins",
}

will cause this error. Running :UpdateRemotePlugins manually works as expected and the equivalent in packer (run = ":UpdateRemotePlugins") also works fine so I believe this is a bug.

Steps To Reproduce

  1. Try to install the following plugin as so:
{
    "wookayin/semshi",
    build = ":UpdateRemotePlugins",
}
  1. See the error.

Expected Behavior

No error is reported and UpdateRemotePlugins runs successfully.

Repro

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({
        "git",
        "clone",
        "--filter=blob:none",
        "https://github.com/folke/lazy.nvim.git",
        "--branch=stable", -- latest stable release
        lazypath,
    })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
    {
        "wookayin/semshi",
        build = ":UpdateRemotePlugins",
    }
})
@HawkinsT HawkinsT added the bug Something isn't working label Jan 13, 2023
@max397574
Copy link
Contributor

perhaps for this the plugin needs to be loaded (setup called)?

@folke
Copy link
Owner

folke commented Jan 13, 2023

It's because the rplugin has not been loaded yet when the build gets triggered. Will see how this can be solved

@folke
Copy link
Owner

folke commented Jan 13, 2023

@max397574 when building a plugin, the plugin is always loaded (regardless of lazy loading), so that was working as expected already

@LeonHeidelbach
Copy link

LeonHeidelbach commented Mar 20, 2023

@folke I get the same issue on the current HEAD 887eb75. If I manually try to run :UpdateRemotePlugins I get "E492: Not an editor command: UpdateRemotePlugins". If I then try to run the command directly like this :call remote#host#UpdateRemotePlugins() I get the error "E121: Undefined variable: g:loaded_remote_plugins". It seems like the plugin is never loaded. Is there some manual setup required to load the rplugin correctly?

Running this command from your commit 666ed7b: :lua vim.cmd([[silent! runtime plugin/rplugin.vim]]) loads the plugin and also registers the :UpdateRemotePlugins user command. Running :UpdateRemotePlugins afterwards properly generates the rplugin.vim file in the data directory. Since the rplugin is never loaded on startup though, plugins like wilder do not work.

@folke
Copy link
Owner

folke commented Mar 20, 2023

@LeonHeidelbach did you disable rplugin in lazy's config?

You shouldn't obviously

@LeonHeidelbach
Copy link

@folke Oh damn, thank you for the quick hint. I did not disable the plugin myself, but since I am using NvChad and just switched to v.2.0 with Lazy I didn't know that there was a separate option to disable default plugins. This is the corresponding line for anyone who might run into the same problem. I really do not know why this would be disabled by default in NvChad though. I must say the speed improvement compared to my prior Packer setup even without lazy loading most of the plugins atm., is quite remarkable. Great job!

@max397574
Copy link
Contributor

max397574 commented Mar 20, 2023

it's disabled by default so it's faster ig 🤷

@LeonHeidelbach
Copy link

LeonHeidelbach commented Mar 20, 2023

The speed improvement of this is most likely not even measurable though 😉. It just causes problems like this one 😆.

@kushb30
Copy link

kushb30 commented May 28, 2024

@folke Oh damn, thank you for the quick hint. I did not disable the plugin myself, but since I am using NvChad and just switched to v.2.0 with Lazy I didn't know that there was a separate option to disable default plugins. This is the corresponding line for anyone who might run into the same problem. I really do not know why this would be disabled by default in NvChad though. I must say the speed improvement compared to my prior Packer setup even without lazy loading most of the plugins atm., is quite remarkable. Great job!

@LeonHeidelbach i tried removing the line still it is not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants