- Run devcontainer up (
.X11-unix
is needed for clipboard to work)
devcontainer up --remove-existing-container --mount "type=bind,source=$HOME/.config/nvim,target=/nvim-config" --mount "type=bind,source=/tmp/.X11-unix,target=/tmp/.X11-unix" --workspace-folder .
devcontainer exec --workspace-folder . --remote-env DISPLAY=$DISPLAY bash -c "sudo apt update && sudo apt install -y xclip && curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage && chmod +x nvim.appimage && ./nvim.appimage --appimage-extract && sudo mv squashfs-root /nvim && sudo ln -s /nvim/AppRun /bin/nvim && mkdir -p ~/.config/ && ln -s /nvim-config ~/.config/nvim"
- Enter container:
devcontainer exec --workspace-folder . --remote-env DISPLAY=$DISPLAY zsh
- Install xclip inside the container for clipboard:
sudo apt update && sudo apt install -y xclip
- Instal nvim in the container (the AppImage ensures it is a recent version):
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
chmod +x nvim.appimage
./nvim.appimage --appimage-extract
sudo mv squashfs-root /nvim
sudo ln -s /nvim/AppRun /bin/nvim
- Link nvim config to the correct place (until we can use
XDG_CONFIG_HOME
directly ondevcontainer up
):
mkdir -p ~/.config/ && ln -s /nvim-config ~/.config/nvim
devcontainer exec --workspace-folder . --remote-env DISPLAY=$DISPLAY bash -c "nvim ."
If running Wayland, you may need to do the following on the host:
xhost +local:docker
Have you ever managed to get Lazy nvim working? The plugin manager, not the distribution. Cheers!