nosduco / remote-sshfs.nvim

Explore, edit, and develop on a remote machine via SSHFS with Neovim
MIT License
145 stars 6 forks source link

`Include` in .ssh/config #22

Open relaxin101 opened 1 month ago

relaxin101 commented 1 month ago

Hello, my ssh file looks something like this:

ForwardAgent yes
IdentityFile /path/to/key

Include ~/.ssh/configs/*

My question is if it's possible to use this Include to load all of the other ssh configs somehow, since I split my ssh configs into a bunch of different files and don't want to add all of them individually. I tried just importing them with

require('remote-sshfs').setup({
     ssh_configs = {
        vim.fn.expand "$HOME" .. "/.ssh/configs/*"
    }
}

but that doesn't seem to work either. Any ideas?

nosduco commented 1 month ago

Thanks for trying out the plugin! Good use case... Let me try to replicate locally and I'll follow up if I can find a solution or update the plugin :)

nosduco commented 1 month ago

@relaxin101 I didn't fully create a bunch of valid ssh configs but I was able to get the table in the config correctly with the following:

ssh_configs = vim.split(vim.fn.globpath(vim.fn.expand "$HOME" .. "/.ssh/configs", "*"), "\n")

Could you give that a shot and let me know if it works for your use-case? Might add it to a FAQ section if so :)

relaxin101 commented 3 days ago

Oh sorry forgot to answer: Yes that solved my problem ty ^^