This is a tiny update to Running Specs from Vim, Sent to tmux via Tslime from the thoughtbot blog. Go read it, and realize that it's six years old.
I finally set this up yesterday:
" Add vim-test and tslime to vim plugins. Plug 'janko/vim-test' Plug 'jgdavey/tslime.vim' ... " Configure vim-test to execute test command using tslime let test#strategy = "tslime" " Configure <CR> aka the Return key to run my test file. nmap <CR> :TestFile<CR> " I'm still figuring out which test commands make the most sense " in my workflow. Right now, this feels pretty good. nmap <leader><CR> :TestLast<CR>
Now, when I'm in normal mode and hit the return key, rspec gets executed for the current file in a different tmux pane (!!). What I didn't understand before using this was how it would select the correct pane. Turns out, it's super easy. On the first run, it asks me for the tmux session, window, and pane (if necessary). After that, it remembers and it always sends the test command there. Super cool!