christoomey / vim-tmux-runner

Vim and tmux, sittin' in a tree...
MIT License
291 stars 37 forks source link

Creating a pane and closing it cause that subsequence command execution to not work #31

Closed cored closed 9 years ago

cored commented 9 years ago

I have a keybinding to run pry and also rails console. Everytime I run it once it works and pry get's run but if I close the pane and try it again then the command stop working.

Configuration:

nmap <silent> <Leader>pp :VtrOpenRunner {'orientation': 'v', 'percentage': 20, 'cmd': 'pry'}<CR>¬

Maybe I'm doing something wrong; I have the same issue trying to get tmux-runner workign with vim-rspec.

I tried to follow the same configuration as @gabebw from his dotfiles after watching the Upcase Weekly iteration video about tightening the TDD loop.

Thanks in advance for your help.

gabebw commented 9 years ago

Hi,

I believe vim-tmux-runner assumes that the same pane still exists, so if you close it, it breaks. Usually I leave the pane open once VTR has opened it for me.

If you've closed the runner pane, you can open a new pane then run :VtrAttachToPane to tell VTR to attach to your new pane. I have it bound to <Leader>va: https://github.com/gabebw/dotfiles/blob/master/vim/rcplugins/vim-tmux-runner.vim

cored commented 9 years ago

The thing is that id I switch pane I don't like that it's zoom out the pane also I would like to change focus to that pane programmatically so in the case of running a console I could switch to it. Is there a way to accomplish this?

On Sun, Dec 21, 2014, 12:59 PM Gabe Berke-Williams notifications@github.com wrote:

Hi,

I believe vim-tmux-runner assumes that the same pane still exists, so if you close it, it breaks. Usually I leave the pane open once VTR has opened it for me.

If you've closed the runner pane, you can open a new pane then run :VtrAttachToPane to tell VTR to attach to your new pane. I have it bound to va: https://github.com/gabebw/dotfiles/blob/master/vim/rcplugins/vim-tmux-runner.vim

— Reply to this email directly or view it on GitHub https://github.com/christoomey/vim-tmux-runner/issues/31#issuecomment-67778419 .

christoomey commented 9 years ago

Hello @cored, everything @gabebw is correct. I believe :VtrAttachToPane will provided the ability to attach to a pane with a running console.

Alternately, f you want to close and then later reopen the runner, you'll need to close it via the provided :VtrKillRunner command or dismiss it (detach to a new window). This is mapped to <leader>kr if you're using the provided commands.

cored commented 9 years ago

@christoomey thanks, what about running the runner and got it focus instantly is that possible could not see anything in the docs.

On Sun, Dec 21, 2014, 4:53 PM Chris Toomey notifications@github.com wrote:

Hello @cored https://github.com/cored, everything @gabebw https://github.com/gabebw is correct. I believe :VtrAttachToPane will provided the ability to attach to a pane with a running console.

Alternately, f you want to close and then later reopen the runner, you'll need to close it via the provided :VtrKillRunner command or dismiss it (detach to a new window). This is mapped to kr if you're using the provided commands. `

— Reply to this email directly or view it on GitHub https://github.com/christoomey/vim-tmux-runner/issues/31#issuecomment-67786451 .

christoomey commented 9 years ago

Hello @cored, if by running the runner and got it focus instantly you mean that a tmux pane would be opened, and that pane would be he active pane, then that is not possible with tmux-runner. The purpose of tmux-runner is explicitly to keep the focused pane as Vim, but still be able to interact with a secondary pane for execution of commands.

That said, you can get that behavior by simply splitting open a new pane with normal tmux functionality (split-window -h or similar) as that will automatically focus the runner pane.

I'm going to close this now as I don't feel there are any actual issues, although there might be some documentation cleanup that could help with making all of this clearer to new users. @cored please reopen or comment back if you continue to run into trouble, but hopefully the answers above are enough to get you running with the workflow you want.