

Faster TDD feedback with tmux, tslime.vim, and turbux.vim - lucaspiller
http://joshuadavey.com/post/15619414829/faster-tdd-feedback-with-tmux-tslime-vim-and

======
luser001
+1 for tmux. I still have two pet peeves with tmux. Nicholas (maintainer of
tmux), if you're reading this ... :)

All in all, tmux is one of the greatest programs ever. Even when working
locally, I prefer to work within a tmux session. I've got single-key pane-
switching shortcuts. Along with the inability of native terminals to create a
vertical split (AFAIK), this is a significant productivity enhancer.

1\. Too aggressive buffering of pane output. runaway output on some panes (due
to e.g. a bug in the program running in the window, not tmux) will really hose
things up so bad that the only way to fix it is to disconnect the underlying
ssh connection.

I'd like to be able to specify a maximum data rate on a per-client basis. If
any client is backed up, freeze panes visible to that client.

2\. The keep changing the pane switching key bindings with every new release.
:| With 1.5, they've taken away the ability to rotate thru every pane in a
window in order: i.e., no concept of a "next" window. Only left and right.

3\. I wish they'd add the option to move to the "next clockwise pane" or "next
counterclockwise pane". Maybe the new left-right infra might help with that.

Yeah, yeah, it's open source. I should probably go fix it myself instead of
whining on a forum. Maybe I will one of these days. :)

~~~
callahad
iTerm2 on Mac OS X supports native vertical splits.

~~~
mafro
I've recently taken to having a tmux session on the left (with split panes)
and then an iTerm2 split pane on the right, so I get a full terminal scroll
back.

The keyboard shortcuts do get a bit confusing at times!

------
bricestacey
I recommend anyone wishing to use something like this first try to implement
it yourself first. It's remarkable how easy it is to script tmux and vim. If
you have a split screen it's as simple as a vim mapping that executes !tmux
send-keys -t right 'rspec %'

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.

~~~
joshuadavey
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!

~~~
bricestacey
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.

------
evolve2k
'A practice that is quickly gaining popularity in the Ruby community is
isolating your business logic from your persistance logic and framework.'

Anyone have links/further reading for this?

~~~
tialys
Arguably the start of the big community push in that direction was Corey
Haines' "Fast Rails Tests" talk, which is really just a clever way of
presenting the separation of logic argument. See:
[http://arrrrcamp.be/videos/2011/corey-haines---fast-rails-
te...](http://arrrrcamp.be/videos/2011/corey-haines---fast-rails-tests/) (or
google "fast rails tests corey haines" for other videos)

------
johncoltrane
Pinboarded for future reading.

`tmux` is great, but am I the only one unable to use `$ vim --remote file.txt`
accross panes in `tmux`?

