Make sure to use "Solarized Dark" compatible theme or color palette may look weird. You can configure terminal color mode by setting TERM variable docker run ... -e TERM=<VALUE> bloodstar/vim
By default the <VALUE> is xterm-256color but for the "less colorful" terminals set it to xterm.
Make an alias:alias edit='docker run -ti --rm -v $(pwd):/home/developer/workspace bloodstar/vim'Have fun!edit some.fileAlso You can use this one for getting updates:alias edit_update="docker pull bloodstar/vim:latest"
For the full Golang support you need to mount /usr/lib/go. For example, run jare/go-tools in the detached mode docker create -v /usr/lib/go --name vim-go-tools jare/go-tools /bin/true and mount its volumes like this docker run ... --volumes-from vim-go-tools ... bloodstar/vim or add it to the alias alias edit="docker run -ti --rm --volumes-from go-tools -v $(pwd):/home/developer/workspace bloodstar/vim"
If you want to use a go-tool , but vim-go doesn't provide a shorthand - you can simply type, for example, :!gofmt % and it will output formatted source of the current buffers(%:p absolute file path, %:h head of the file name and %:p:h is the current directory). If you want to overwrite - use :% ! gofmt % The gofmt tool used as an example, actually, it covered in vim-go.
Alternatively, you can put something like this into .bashrc to automatically bootstrap all containers:
#docker vim
function ed() {
local dtc_id=$(docker ps -a -q --filter 'name=vim-go-tools')
if [[ -z "${dtc_id}" ]]; then
echo 'vim-go-tools container not found. Creating...'
docker create -v '/usr/lib/go' --name 'vim-go-tools' \
'bloodstar/go-tools' '/bin/true'
echo 'Done!'
fi
echo 'Starting Vim'
docker run -ti --rm -p 8080:8080 --volumes-from 'vim-go-tools' \
-v $('pwd'):/home/developer/workspace 'bloodstar/vim' "${@}"
}
export -f ed