I’m sure most power developers have their tests bound to hot-keys in their favorite IDE, and having them in Vim is no different. I fell in love with the vim-rspec that Thoughtbot put out. It has served me well over the years and has saved me countless hours in running tests by allowing me to run them from a few short key strokes. Times have moved on however; and I needed a way to run tests in other languages.
When I got more into Erlang I cloned the closet Vim plugin project I could find
that worked like vim-rspec
and mapped them to <leader>es
, <leader>et
, etc.
The idea was they where a near one-to-one clone of the vim-rspec
plugin keys I
had setup, where a simple <leader>s
, <leader>t
, and so on. This went okay
for awhile until I added Elixir to the mix. I then had yet another set of key
strokes to remember!
Worst of all, in my head the vim-rpsec
key-bindings would always overpower the
other language key-bindings. Thats when I said enough is enough! I did some
reading and wrote some of my own Vim script to move all of my tests to the same
keystrokes. I was able to do this using filetype
in my script. Here it is in
it’s entirety:
|
This has me a little more excited to learn some more Vim script and automate more of tedious daily work away!