Skip to content

goropikari/local-devcontainer.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

local-devcontainer.nvim

Launch devcontainer from neovim and connect the container via ssh.

demo

Installation

With lazy.nvim

{
  'goropikari/local-devcontainer.nvim',
  dependencies = {
    'ojroques/nvim-osc52',
    'goropikari/termitary-mod.nvim',
  },
  opts = {
    -- some opts
  },
}

Required

devcontainer cli, socat are required.

npm install -g @devcontainers/cli

sudo apt-get install -y socat

Setup

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'
})

Usage

lua require('local-devcontainer').up()
vim.api.nvim_create_user_command(
  "DevContainerUp",
  require('local-devcontainer').up,
  {}
)

TODO

  • When neovim supports vim's remote_foreground, stop creating terminal tabs and move to it.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published