Love, hate, & tmux

It seems like everywhere I turn lately, I run into tmux.

Nick, Josh, Harold, and Goose are running their editor shell combos inside of tmux on a daily basis. When I wanted to know more about remote pair programming with ssh, vim, and GNU screen, Stephen Caudill’s awesome article suggested tmux was superior to screen. Then, Bryan Liles recorded a tmux screencast.

I’m always down for a ride on a bandwagon, so I’m giving tmux a shot. I’ve rarely used GNU screen so this is not a comparison between two similar tools. I’m evaluating a tool many of my peers are using.

These are the questions I’ve had so far.

Why should I care?

“[Terminal tabs]: that’s not awesome.” - Bryan Liles.

I like the idea of having one shell for my whole development environment that I fly around inside like a Tasmanian devil.

I want speed and focus.

How do I get started?

I went with Bryan’s suggestion and downloaded iTerm 2. While I’m still on the fence about tmux, iTerm 2 is definitely an improvement and I recommend it without reservation.

Then I installed tmux, read the documentation, and fired it up.

brew install tmux
man tmux
tmux -u

Can I make the environment look good?

In my opinion, no. Anti-aliasing and 256 colors is the state of the art here. If I wanted a beautiful-looking editor, I’d still be using Textmate. I’m willing to trade off looks for speed. I know people who are very fast in other editors. I feel my ceiling for speed is higher in vim.

Josh tells me you can make some good-looking vim schemes with Palette that will be automatically converted to 256 colors. We’ll see.

How can I scroll up to see my backtraces?

This was non-obvious to me. You enter “copy mode” using prefix [, then use vim bindings to move up (Ctrl b, j, k, etc.).

Why is vim so slow?

There’s a noticeable delay in the editor that doesn’t exist in MacVim. I haven’t figured out why yet. I suspect it might actually be iTerm 2.

How can I copy text?

Enter “copy mode” using prefix [, use vim bindings to move, select with space, copy with enter. This will let you copy and paste within tmux.

The bigger issue is copying text from within tmux and pasting it elsewhere. The very latest Homebrew formula has a patch to fix a pboard problem with copying in Mac OS X. It mostly works.

What are people doing to their ~/.tmux.conf?

Most common amongst thoughtbot folks and blog posts is to make tmux act more like vim and GNU screen.

# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t : 

# act like GNU screen
unbind C-b
set -g prefix C-a

# look good
set -g default-terminal "screen-256color"

How do I name sessions?

One day I might work on Hoptoad. Another day, a client project. I’d like to name my tmux sessions so I can leave one, drop into another, and go back to the original with all my state maintained (files still open in my editor, console/logs I want open, etc.).

tmux new -s hoptoad
# hack, leave, do something else
tmux attach -t hoptoad

This is my favorite feature so far.

How do I split and move about panes and windows?

This is a big selling point of tmux but I’m not convinced. Contrast the following with Command Tab or using your mouse to move and click. In terms of speed, it’s probably six or one half dozen.

Using vim and GNU screen bindings:

Ctrl a c # create a new window
Ctrl a , # name the window (test, vim, console, log, etc.)
Ctrl a " # split pane horizontally
Ctrl a % # split pane vertically
Ctrl a j (or k) # move up or down a pane
Ctrl a h (or l) # move left or right a pane
Ctrl a x # kill a pane or window

I believe in the philosophy of setting my mouse free but the reality is takes time for muscle memory to make this fast and the savings might not really be significant.

Give it a shot

I’ve had a love-hate relationship with tmux in my first week using it, but the brief moments of flow I’ve experienced so far are enough to keep trying it.

Give tmux a shot and if you have any other tips, I’d love to hear them.

I'm currently trying out tmux, so far I like it, nice minimal approach.

CSS3 buttons

CSS3 buttons

This is a collection of buttons that show what is possible using CSS3 while also maintaining the simplest possible markup. They look best in WebKit-based browsers, almost as good in Firefox, with all other browsers falling back to a less-styled button. If you use these buttons in the wild, drop me a note and let me know.

The latest code is located at: http://github.com/ubuwaits/css3-buttons

Classic buttons

This is the original set of buttons, showing a variety of CSS3 styles in different combinations. Study the code, then adjust to fit the context of where it's used.

  • Minimal
  • Clean Gray
  • Cupid Green
  • Cupid Blue
  • Blue Pill
  • Dribbble
  • Slick Black
  • thoughtbot
  • Punch
  • Blue Candy
  • Purple Candy
  • Shiny Blue
  • Download iTunes
  • Skip
  • Minimal Indent

WebKit experimental

Proof of concept buttons using WebKit-only features.

  • Quit!
  • Approve!
  • Accept

Designed & Maintained by Chad Mazzola with inspiration from across the internet.

Awesome set of CSS3 buttons

The Idealist

Worryingly accurate description of me.

Portrait of an INFP

INFPs do not like conflict, and go to great lengths to avoid it. If they must face it, they will always approach it from the perspective of their feelings. In conflict situations, INFPs place little importance on who is right and who is wrong. They focus on the way that the conflict makes them feel, and indeed don't really care whether or not they're right. They don't want to feel badly. This trait sometimes makes them appear irrational and illogical in conflict situations. On the other hand, INFPs make very good mediators, and are typically good at solving other people's conflicts, because they intuitively understand people's perspectives and feelings, and genuinely want to help them.

INFPs are flexible and laid-back, until one of their values is violated. In the face of their value system being threatened, INFPs can become aggressive defenders, fighting passionately for their cause. When an INFP has adopted a project or job which they're interested in, it usually becomes a "cause" for them. Although they are not detail-oriented individuals, they will cover every possible detail with determination and vigor when working for their "cause".