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

Non-standard config path in local #137

Closed
knmac opened this issue May 25, 2024 · 6 comments · Fixed by #139 or #142
Closed

Non-standard config path in local #137

knmac opened this issue May 25, 2024 · 6 comments · Fixed by #139 or #142

Comments

@knmac
Copy link

knmac commented May 25, 2024

Is your feature request related to a problem? Please describe.
Having a non-standard config path in local machine prevents loading the config on remote. For example, if the path to the config is ~/.config/weird_nvim/, then after copying the config over, there will be two directories on remote:

  • ~/.remote-nvim/workspaces/[workspace_tag]/.config/weird_nvim/, this is the copied config folder from local, and
  • ~/.remote-nvim/workspaces/[workspace_tag]/.config/nvim/, this is the empty default config folder. Remote-nvim will load from this instead of the other folder.

Describe the solution you'd like
Specifying with remote config folder to load. This is similar to NVIM_APPNAME. For example,

copy_dirs = {
  config = {
    base = vim.fn.stdpath("config"),
    dirs = "*",
    nvim_appname = "weird_nvim",
  }
}
@amitds1997
Copy link
Owner

Thanks for reporting this! I am able to reproduce the issue. Will push out a fix soon.

@amitds1997
Copy link
Owner

amitds1997 commented May 26, 2024

Hey, I pushed out a fix and released it in v0.3.9. Let me know if you are able to work with it now.

Your updated configuration should look like:

remote = {
    app_name = "weird-nvim",
    -- List of directories that should be copied over
    copy_dirs = {
      config = {
        base = "<path-to-weird-nvim>",
      }
    }

Moved app_name out because NVIM_APPNAME overrides all XDG_CONFIG_* paths. If you still see this issue, let me know. Thanks!

@knmac
Copy link
Author

knmac commented May 26, 2024

It seems if sub-dirs are specified, they are not copied to the correct path on remote? For example, the following config

remote = {
    app_name = "weird-nvim",
    copy_dirs = {
      config = {
        base = "<path-to-weird-nvim>",
        dirs = {"lonely-dir"},
      }
    }

would result in an empty ~/.remote-nvim/workspaces/[workspace_tag]/.config/weird-nvim/ and ~/.remote-nvim/workspaces/[workspace_tag]/.config/lonely-dir/, while the lonely-dir is expected to be inside weird-nvim/.

@amitds1997 amitds1997 reopened this May 26, 2024
@amitds1997
Copy link
Owner

Sorry, did not see your message come in. Was able to reproduce this. I would implement and push the fix in the next couple of hours. The earlier fix broke this behavior apparently 😢

@amitds1997
Copy link
Owner

Hi, thanks for being patient. I merged a fix so both the scenarios work Ok now. Let me know if you still see any issues.

@knmac
Copy link
Author

knmac commented Jun 10, 2024

That looks great! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants