Re:Faster TDD feedback with tmux, tslime.vim, and turbux.vim
by joshuadavey on Tuesday January 17, 2012 @11:36AM
(#3475388)
Thanks, Brice! I also recommend implementing it yourself first. After I did just that, I found myself wanting a little bit more smarts with my vim mapping. Since most of my work is in rails, and I use rails.vim, I was able leverage rails.vim's buffer detection for alternate files.
In essence, if I'm in a controller that has a corresponding spec or test, the mapping with run that spec. If there is no corresponding spec, it will run the most recent command again. I find this useful for outside-in development, where a change in a controller might make a cucumber scenario pass.
I would, however, add that the command you mention above would need to include C-m at the end to actually send the terminal a "newline" character, thereby running the command.
In any case, I appreciate your interest in the project, and your helpful example!
Re:Faster TDD feedback with tmux, tslime.vim, and turbux.vim
by bricestacey on Wednesday January 18, 2012 @08:24PM
(#3482773)
I would normally leave this as is, but adding the C-m at the end is non-trivial so I wanted to give a more proper example. You're right, it should be:
!tmux send-keys -t right 'rspec %' C-m
Notice the C-m is not quoted.Definitely want to give a big +1, but it's really cool/useful to know what's going on under the hood.
Not dissing the project - I would recommend then using a more battle-tested project (like maybe this one) if you find yourself needing something more generic and complicated.