TMUX remote command execution from VIM. Includes shorthand for running rspec tests. This plugin is similar but less feature-rich than Tim Pope's vim-dispatch.
Pathogen
cd ~/.vim/bundle
git clone git@github.com:tphang/vim-tmx.git
###tmx#send()
Sending a command to a tmux session is as simple as :TMXSend ls. This will prompt you for tmux target info (sesion, window and panel) and fire off the command. A target will be remembered for the duration of your VIM session. To select a different target send :TMXReset and then your new target.
###tmx#rspec()
To kick off an rspec test run issue :TMXRspec with an optional filename. If no filename is provided, the current file will be used. To run the whole test suite use :TMXRspec .. This will run rspec in your target tmux session and give you a summary of the results. If you have vim compiled with the +clientserver option, any resulting failures will be pushed into a VIM quickfix window. Most GUI versions of vim have are compiled with this option. If you are running multiple versions of vim and you have not linked vim to mvim, you may need to add let g:tmx_vim_progname=mvim by default it is set to v:progname. Run :cope[n] to toggle the quickfix window open and jump to the first error.
###tmx#rubocop()
To start an async rubocop run issue :TMXRubocop with an optional filename. If no filename is provided, the current file will be used. To run rubocop accross an entire project use :RMXRspec .. Similar to rspec, rubocop will also to output a quickfix file if you have vim compiled with +clientserver.
###Example Mappings###
By default, this plugin does not include any mappings but it can be especially useful for anything you do repeatedly. Add the following to your ~/.vimrc.
"<leader>t to test current file
map <leader>t :TMXRspec<CR>
"<leader>s to syntax check current file
map <leader>s :TMXRubocop<CR>