distant.nvim icon indicating copy to clipboard operation
distant.nvim copied to clipboard

Offering different public keys

Open david-perez opened this issue 4 years ago • 1 comments

Thanks for this useful plugin and your talk in VimConf.

I see that the distant binary has support for setting identity_files.

However, I can't figure out what to feed the :DistantLaunch command so that it parses the ssh.identity_files input into something that mlua can smoothly deserialize into a Vec<PathBuf>, e.g.

:DistantLaunch my.host.com ssh.identity_files=["~/.ssh/id_rsa_distant"]

david-perez avatar Oct 30 '21 15:10 david-perez

@david-perez I think this is a limitation of the input parser for commands not supporting lists.

You may be able to get away with adding a configuration to your host during setup and provide a list in lua, though.

require('distant').setup {
    ['*'] = vim.tbl_deep_extend('force', settings.chip_default(), {
        ssh = {
            identity_files = { '/path/to/.ssh/id_rsa_distant' },
        }
    })
}

For the command to support a list, we'd either need to add list parsing support to the parser or have a check to split a string by comma or some other delimiter similar to how we convert certain settings to a number like ssh.port before passing to the Rust function.

chipsenkbeil avatar Oct 30 '21 21:10 chipsenkbeil

Closing out as an outdated issue. With v0.3 being the new branch, feel free to open a new issue against it if this is still a problem.

chipsenkbeil avatar Aug 26 '23 22:08 chipsenkbeil