lazy plugin installed, but not loaded; how to use it?
Closed this issue · 12 comments
Describe the bug
I have installed the plugin with lazy following the instructions in the README and it shows as installed. However if I do :RemoteStart, it is not available.
Expected behavior
I was expecting to work when I write the command :RemoteStart.
Screenshots
System info
- Your local OS: Slackware Linux
- Local Neovim version: 0.9.0
- Remote host OS (if applicable):
- Remote Neovim version (if applicable):
Additional context
Did I miss anything in the configuration? I have only copied this:
{
"amitds1997/remote-nvim.nvim",
version = "v0.2.2", -- Pin to GitHub releases
dependencies = {
"nvim-lua/plenary.nvim", -- For standard functions
"MunifTanjim/nui.nvim", -- To build the plugin UI
"nvim-telescope/telescope.nvim", -- For picking b/w different remote methods
},
config = true,
}
and added to the file lua/custom/plugins.lua where there are all my other plugins (see screenshot).
Perhaps you are lazy loading your plugins? I see the plugin is installed but not loaded. Run Lazy load remote-nvim.nvim
and it should get loaded. You should be able to use the commands after.
If this is the case, I would suggest adding either lazy = false
, cmd = { ":RemoteStart" }
or event = { "CmdlineEnter" }
to the plugin configuration to make it load appropriately.
Thanks. Now it is loaded.
Then I put the ssh string and it asks for the password. I tried to insert the password, but nothing happened.
Actually it is not clear where the cursor should be to insert the password.
Note: my ssh string does not use the standard port 22, so I wrote something like:
ssh -p 6677 user@ipaddress
I have another question. If neovim is already installed and configured on the remote machine, can I use that one already installed?
There should be a popup that should allow you to enter the password 🤔 It should show up automatically. Maybe it is hidden behind this popup. But it should show up as shown in the README password based demo.
I have a PR out for building from source or else using a system Neovim in #93. I have been stretched a bit thin but I should be able to get it done soon.
I got it. The plugin depends upon certain phrases in the output to detect that the ssh process is waiting for an input. You might want to add your prompt to the configuration. See ssh_configs.ssh_prompts
for more information in the README under Advanced Configuration. The added block should be something like
{ match = "Password:", type = "secret", value_type = "static", value = "" }
I'll make a PR to fix this. Thanks for reporting this.
How / where to add the advanced configuration?
Do you have a full example for lazy?
How / where to add the advanced configuration?
Do you have a full example for lazy?
For lazy.nvim
(the plugin manager), something like this should set you up (for a sample configuration I use, see this. Please do not copy the rest of the configuration as it is specific to my machine. You can add more options as per your configuration):
require("remote-nvim").setup({
ssh_config = {
ssh_prompts = { match = "Password:", type = "secret", value_type = "static", value = "" }
}
})
I have not worked with LazyVim, but it uses the same plugin manager so a similar configuration should work. You can also just do it like
{
"amitds1997/remote-nvim.nvim",
...rest of options
opts = {
ssh_config = {
ssh_prompts = { match = "Password:", type = "secret", value_type = "static", value = "" }}
How / where to add the advanced configuration?
Do you have a full example for lazy?
There should be no need to add any new configuration to your own configuration after you pull in the latest version of the plugin that I released right now. Let me know if you still face issues.
However on the remote machine I already have neovim installed with its own configuration. Can I just use that, without install it again? If so, how to do it?
I have a PR out for system Neovim option in #93. This should handle this scenario along with other niceties.
If you already have Neovim installed on the remote along with it's own configuration, you have already done 90% of the job this plugin does though. You can simply launch a remote session and then use a local client to connect to it after enabling port forwarding (that's what this plugin does too behind the scenes).
Something like
ssh -L 8080:8080 <host> nvim --headless --listen 0.0.0.0:8080
and
then run nvim --server=localhost:8080
(This might not be completely accurate but that's how it works)
OK. I see. Thanks for all the information.
I'll go ahead and close this issue since all requirements (except the option of building from source or re-using Neovim already installed on remote, which is being tracked by a different issue). If something is unresolved, feel free to comment and re-open the issue. Thanks!