Trying vim-slime in Docker
(Disclaimer: I wrote vim-slime)
Installing a vim plugin: probably not fun…
Maybe you’ve heard about vim-slime, thought it was cool … but you weren’t sure what you were getting yourself into 🤔
That’s understandable … I feel the same about every vim plugin:
- is it going to be simple to install?
- will it interfere with other plugins?
- if something breaks, will it be easy to fix?
- how much config will be necessary? (for optimum experience)
- is it going to be simple to uninstall?
In this case, I propose a “clean slate” experience. Since you probably don’t have a new computer with a fresh OS install lying around, let’s talk about Docker.
Why Docker?
Is Docker perfect? No. (especially on macOS)
What I appreciate about Docker is: the mess stays inside a container. You’re
always a few commands (docker rm
, docker rmi
, docker system prune
) away from returning to a known/clean state.
I often have to reproduce problems with combinations of config and tools completely different from how I usually work. I would:
- change my config…
- install new tools…
- hope I could reproduce the problem 🤞
git checkout .
my dotfiles back to sanity- remember to uninstall things…
Nothing about this process would “feel good”. Now I try to contain the blast radius inside Docker.
Instructions: vim-slime in Docker
Set up the foundations:
(if, at this point, you’re thinking “why alpine?” … adjust these instructions to your own preferences)
Install vim-slime:
Configure vim-slime:
Try vim-slime:
What’s next?
Everything above was “the minimum”; the least number of steps to try vim-slime.
No magic ❌🪄
Some improvements:
- default tmux is pretty bare, dump your config to
~/.tmux.conf
- default vim is pretty bare, dump your config to
~/.vim/vimrc
(remember to add some vim-slime config…)
A little bit more vim-slime config for your vimrc:
This will use {last}
and won’t even ask for you to confirm the config!
(this is how I work)
If you don’t want to use tmux, there are many other options:
- (GNU) screen
- dtach
- kitty
- x11
- whimrepl
- conemu
- vimterminal
- neovim terminal
See the README for details on how to configure things.
Finally, go step by step – it’s easier to debug that way. And if you need help, open an issue and we’ll figure it out.