Launch devcontainer from neovim and connect the container via ssh.
With lazy.nvim
{
'goropikari/local-devcontainer.nvim',
dependencies = {
'ojroques/nvim-osc52',
'goropikari/termitary-mod.nvim',
},
opts = {
-- some opts
},
}
devcontainer cli, socat are required.
npm install -g @devcontainers/cli
sudo apt-get install -y socat
default parameter
require('local-devcontainer').setup({
ssh = {
user = 'vscode',
host = 'localhost',
port = 2222,
public_key_path = '~/.ssh/id_rsa.pub',
secret_key_path = '~/.ssh/id_rsa',
},
neovim = {
remote_path = '/opt/nvim/squashfs-root/usr/bin/nvim',
},
devcontainer = {
path = 'devcontainer',
args = {
'--workspace-folder=.',
[[--additional-features='{"ghcr.io/goropikari/devcontainer-feature/neovim:1": {}, "ghcr.io/devcontainers/features/sshd:1": {}}']],
}
},
cmd = 'wezterm cli spawn --', -- windows: 'cmd.exe /c "wt.exe" -w 0 nt bash -c'
})
lua require('local-devcontainer').up()
vim.api.nvim_create_user_command(
"DevContainerUp",
require('local-devcontainer').up,
{}
)
- When neovim supports vim's remote_foreground, stop creating terminal tabs and move to it.