Container with pre-configured shell and editor. Used to keep a familiar dev experience when exploring new languages, tools, etc.
To work on local files inside a ./workspace
directory:
$ docker run -it -v `pwd`/workspace:/opt/workspace minustime/with-vim:ubuntu-bionic
OR
Even better, create a shortcut for it!
- Update your
~/.bashrc
file with this function:
// In .bashrc
function with-vim {
local WS="$PWD/workspace"
if [[ ! -z "$1" ]]; then
if [[ -d "$1" ]]; then
cd "$1"
WS="$(pwd)"
cd -
else
WS="$PWD/$1"
fi
fi
docker run -it -v "$WS:/opt/workspace" minustime/with-vim:ubuntu-bionic
}
- Source it
$ source ~/.bashrc
- Run it against any directory:
$ with-vim .
This can also be used as a temporary base image for another project:
FROM minustime/with-vim:ubuntu-bionic
USER root
RUN which nvim
USER ${USER}
CMD ["sleep", "infinity"]
- Clone this repo:
$ git clone [email protected]:minustime/with-vim.git && cd with-vim
- Build, run and access the container:
$ make code
- Oh My Zsh + vim-mode
- Neovim