remote-sshfs.nvim icon indicating copy to clipboard operation
remote-sshfs.nvim copied to clipboard

`Include` in .ssh/config

Open relaxin101 opened this issue 1 year ago • 3 comments

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?

relaxin101 avatar May 29 '24 09:05 relaxin101

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 avatar May 30 '24 02:05 nosduco

@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 :)

nosduco avatar May 30 '24 02:05 nosduco

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

relaxin101 avatar Jun 27 '24 19:06 relaxin101