personal neovim configuration as a Docker image
622
My personal neovim environment (neovim + tools) as a Docker image
cd into your top level project directory, then run the following docker
command:
docker run \
--rm -it \
[-e UID="1000" \]
[-e GID="1000" \]
[-v <your init.vim directory>:/home/neovim/.config/nvim \]
-v <your workspace top level dir>:/mnt/workspace \
nicodebo/neovim-docker:latest \
[nvim arguments]
docker run \
--rm -it \
-v $(pwd):/mnt/workspace \
nicodebo/neovim-docker:latest \
-o file1 file2
.dotfile directory under your $HOME:docker run \
--rm -it \
-v $(pwd):/mnt/workspace \
-v $HOME/.dotfiles/nvim:/home/neovim/.config/nvim \
nicodebo/neovim-docker:latest \
file1
user id (1000) and group id (1000) of the container does not match user id and group id of the host.docker run \
--rm -it \
-v $(pwd):/mnt/workspace \
-e UID="1003" \
-e GID="1004" \
nicodebo/neovim-docker:latest \
-o file1 file2
You can find out your host user id and group id with the following command: $ id
For conveniance, you might want to define a function in your shell configuration (bashrc, zshrc,…) to run neovim-docker as an executable, e.g.:
nvim() {
docker run \
--rm -it \
-v $(pwd):/mnt/workspace \
-v $HOME/.dotfiles/nvim:/home/neovim/.config/nvim \
nicodebo/neovim-docker:latest \
"$@"
}
You must cd into the directory (preferably the top level directory of your
project) where the files you want to edit are located.
Content type
Image
Digest
Size
73.4 MB
Last updated
over 6 years ago
docker pull nicodebo/neovim-docker